JobScheduler.php 806 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\job\event;
  3. use app\common\model\app\App as AppModel;
  4. use think\facade\Cache;
  5. /**
  6. * 订单事件管理
  7. */
  8. class JobScheduler
  9. {
  10. /**
  11. * 执行函数
  12. */
  13. public function handle()
  14. {
  15. // 查找所有appid
  16. $appList = AppModel::getAll();
  17. // 涉及到应用单独配置的,循环执行
  18. foreach ($appList as $app){
  19. // 订单任务
  20. event('Order', $app['app_id']);
  21. // 同步直播
  22. event('Live', $app['app_id'], count($appList));
  23. }
  24. // 拼团任务
  25. event('AssembleBill');
  26. // 砍价任务
  27. event('BargainTask');
  28. // 用户优惠券
  29. event('UserCoupon');
  30. // 分销商订单
  31. event('AgentOrder');
  32. return true;
  33. }
  34. }