抖音小程序

SyncAdPlacement.php 906B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Service\AdService;
  4. use Illuminate\Console\Command;
  5. class SyncAdPlacement extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = 'SyncAdPlacement';
  13. /**
  14. * The console command description.
  15. *
  16. * @var string
  17. */
  18. protected $description = '定时更新广告位信息';
  19. public function handle()
  20. {
  21. \DB::connection()->disableQueryLog();
  22. $this->info(date('m-d H:i:s') . ' 开始整理');
  23. $appList = config('douyin.app_info');
  24. foreach($appList as $appInfo) {
  25. $this->stat($appInfo);
  26. }
  27. $this->info(date('m-d H:i:s') . ' 整理结束');
  28. }
  29. public static function stat($appInfo) {
  30. $appId = $appInfo['app_id'];
  31. $flag = AdService::syncAdPlacement($appId);
  32. }
  33. }