SendCustomWechatMaterial.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Console\Commands\BatchWechatMaterial;
  3. use Illuminate\Console\Command;
  4. use App\Modules\WechatMaterial\Services\BatchWechatCustomSendService;
  5. use Redis;
  6. /**
  7. * 发送微信素材客服消息
  8. *
  9. */
  10. class SendCustomWechatMaterial extends Command
  11. {
  12. /**
  13. * The name and signature of the console command.
  14. *
  15. * @var string
  16. */
  17. protected $signature = 'BatchWechatMaterial:SendCustomWechatMaterial';
  18. /**
  19. * The console command description.
  20. *
  21. * @var string
  22. */
  23. protected $description = '发送微信素材客服消息';
  24. /**
  25. * Create a new command instance.
  26. *
  27. * @return void
  28. */
  29. public function __construct()
  30. {
  31. parent::__construct();
  32. }
  33. /**
  34. * Execute the console command.
  35. *
  36. * @return mixed
  37. */
  38. public function handle()
  39. {
  40. $this->start();
  41. }
  42. public function start(){
  43. \Log::info('send_custom_wechat_material_start');
  44. switch_global_db('api_mysql','default');
  45. BatchWechatCustomSendService::toCheckAndSendBatchCustomMsg();
  46. switch_global_db('mysql','default');
  47. \Log::info('send_custom_wechat_material_end:');
  48. }
  49. }