小说推广数据系统

AdAccountRelationToRds.php 726B

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