1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Console\Commands;
- use App\Models\VpAdAccountRelation;
- use App\RedisModel;
- use App\Services\YouZiService;
- use Illuminate\Console\Command;
- class AdAccountRelationToRds extends Command
- {
- protected $signature = 'AdAccountRelationToRds';
- protected $description = '腾讯广告账户关联的公众账号信息列表存入Redis';
- public function handle()
- {
- $accountList = VpAdAccountRelation::selectRaw("app_id, ad_app_id, ma_app_id, action_set_id")
- ->where('enable', 1)->get()->toArray();
- $this->info('本次共处理'.count($accountList).'个账号信息');
- RedisModel::setAfterEncode(YouZiService::AD_ACCOUNT_RELATION_RDS_KEY, $accountList);
- }
- }
|