1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Console\Commands;
- use App\Service\AdService;
- use Illuminate\Console\Command;
- class SyncAdPlacement extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'SyncAdPlacement';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '定时更新广告位信息';
- public function handle()
- {
- \DB::connection()->disableQueryLog();
- $this->info(date('m-d H:i:s') . ' 开始整理');
- $appList = config('douyin.app_info');
- foreach($appList as $appInfo) {
- $this->stat($appInfo);
- }
- $this->info(date('m-d H:i:s') . ' 整理结束');
- }
- public static function stat($appInfo) {
- $appId = $appInfo['app_id'];
- $flag = AdService::syncAdPlacement($appId);
- }
- }
|