CpcBillTasks.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Console\Commands\CpcAdvertise;
  3. use App\Modules\Book\Services\SuperiorHistoryBookService;
  4. use App\Modules\CpcAdvertise\Services\ChannelBillsService;
  5. use App\Modules\CpcAdvertise\Services\CpcChannelStatsService;
  6. use DB;
  7. use Illuminate\Console\Command;
  8. class CpcBillTasks extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'CpcAdvertise:bill_task';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = '广告结算';
  22. /**
  23. * Create a new command instance.
  24. *
  25. * @return void
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. }
  31. /**
  32. * Execute the console command.
  33. *
  34. * @return mixed
  35. */
  36. public function handle()
  37. {
  38. //
  39. //$date = date('Y-m-d',strtotime('-2 day'));
  40. for($i=12;$i>=2;$i--){
  41. $date = date('Y-m-d',strtotime('-'.$i.' day'));
  42. ChannelBillsService::generate_bills($date);
  43. }
  44. }
  45. }