Kernel.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. namespace App\Console;
  3. use App\Services\Notice\OldUserRetainedService;
  4. use Illuminate\Console\Scheduling\Schedule;
  5. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  6. /**
  7. * Class Kernel
  8. * @package App\Console
  9. */
  10. class Kernel extends ConsoleKernel
  11. {
  12. /**
  13. * The Artisan commands provided by your application.
  14. *
  15. * @var array
  16. */
  17. protected $commands = [
  18. ];
  19. /**
  20. * Define the application's command schedule.
  21. *
  22. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  23. * @return void
  24. */
  25. protected function schedule(Schedule $schedule)
  26. {
  27. ## 微信公众号
  28. // 定时刷新token
  29. $schedule->command('wechat:access-token')->everyFiveMinutes()->withoutOverlapping();
  30. // 时遇记公众号每日推送
  31. $schedule->command('daily:syj')->dailyAt('22:02')->withoutOverlapping();
  32. ## 福利中心
  33. // 福利抽奖定时
  34. $schedule->command('welfare:lottery')->dailyAt('19:55');
  35. // 福利发奖定时
  36. $schedule->command('welfare:prize')->dailyAt('20:00');
  37. // 福利通知定时
  38. $schedule->command('welfare:notice')->dailyAt('20:05');
  39. ## 契约
  40. // 卡片:心动通知延迟发送
  41. $schedule->command('partner:thumbme:notice:dely')->dailyAt('09:30');
  42. // 心动邀请通知:夜间通知延迟发送
  43. $schedule->command('invitation:notice:dely')->dailyAt('09:30');
  44. // 好友列表:未读消息通知:加载通知用户
  45. // $schedule->command("friendslist:unreadnotice:load")->dailyAt("02:20");
  46. // 好友列表:未读消息通知:发送通知
  47. // $schedule->command("friendslist:unreadnotice:send")->between("8:00", "23:00")->everyFiveMinutes();
  48. ## 晚安
  49. // 榜单
  50. $schedule->command("goodnight:rank total")->everyMinute()->withoutOverlapping();
  51. $schedule->command("goodnight:rank daily")->everyMinute()->withoutOverlapping();
  52. // 创建活动
  53. $schedule->command('goodnight:activity')->dailyAt('02:00');
  54. // 晚安伴侣:订阅推送
  55. $schedule->command('goodnight:push')->dailyAt('22:00');
  56. // 晚安伴侣:匹配伴侣
  57. $schedule->command('goodnight:match')->dailyAt('19:30');
  58. ## 客服号
  59. /**
  60. * 客服号
  61. */
  62. // 清理脚本:微信客服管理:每日发码和加好友数量
  63. $schedule->command('clean:wxkf:daycnt')->dailyAt('00:30');
  64. // 微信客服管理:添加每小时二维码数量
  65. $schedule->command('wxkf:hourqueue:add')->hourly();
  66. // 超级会员:过期通知
  67. $schedule->command('supervip:remindexpire')->twiceDaily(10, 20)->hourly();
  68. // 人气值:好友助力和小fa:过期通知
  69. $schedule->command('popularity:share:flower:expire')->everyTenMinutes();
  70. // 人气值:存储用户今日人气值
  71. $schedule->command('popularity:todaylog:save')->at('23:00');
  72. // 人气值:加载人气值日报推送用户
  73. $schedule->command('popularity:daiyuser:load')->at('01:30');
  74. // 人气值:发送日报
  75. $schedule->command('popularity:daiyuser:push')->between("8:01", "23:01")->everyFiveMinutes();
  76. // 未登录用户模拟点赞
  77. $schedule->command('mockthumb:timing')->between("09:00", "23:59")->everyMinute()->withoutOverlapping();
  78. // 完善卡片提醒-被提醒者
  79. // $schedule->command('operate:remindComplteInfo')
  80. // ->between("08:00", "20:00")->everyMinute()->withoutOverlapping();
  81. // 通知:老用户召回
  82. // $schedule->command('notice:old_user visitor')->hourlyAt(1)->between('8:00', '22:00')->withoutOverlapping();
  83. // $schedule->command('notice:old_user vip')->hourlyAt(2)->between('8:00', '22:00')->withoutOverlapping();
  84. // $schedule->command('notice:old_user once_pair')->hourlyAt(3)->between('8:00', '22:00')->withoutOverlapping();
  85. // $schedule->command('notice:old_user phone_not_card')
  86. // ->hourlyAt(4)->between('8:00', '22:00')->withoutOverlapping();
  87. // $schedule->command('notice:old_user partner')->hourlyAt(5)->between('8:00', '22:00')->withoutOverlapping();
  88. // $schedule->command('notice:old_user cardRecommendCancel')
  89. // ->hourlyAt(6)->between('8:00', '22:00')->withoutOverlapping();
  90. // QQ小程序营销通知
  91. // $schedule->command('notice:qq first')->hourlyAt(31)->between('8:00', '22:00')->withoutOverlapping();
  92. // $schedule->command('notice:qq second')->hourlyAt(32)->between('8:00', '22:00')->withoutOverlapping();
  93. // $schedule->command('notice:qq third')->hourlyAt(33)->between('8:00', '22:00')->withoutOverlapping();
  94. $schedule->call(function () {
  95. $ors = new OldUserRetainedService();
  96. $ors->send();
  97. })->dailyAt("08:25");
  98. // 时遇记公众号营销通知
  99. // $schedule->command('notice:syj a')->between('8:00', '22:00')->everyMinute();
  100. // $schedule->command('notice:syj b')->between('8:00', '22:00')->everyMinute();
  101. // $schedule->command('notice:syj c')->between('8:00', '22:00')->everyMinute();
  102. // $schedule->command('notice:syj d')->between('8:00', '22:00')->everyMinute();
  103. // $schedule->command('notice:syj e')->between('8:00', '22:00')->everyMinute();
  104. // 分配对象公众号营销通知
  105. // $schedule->command('notice:fpdx a')->between('8:00', '22:00')->everyMinute();
  106. // $schedule->command('notice:fpdx b')->between('8:00', '22:00')->everyMinute();
  107. // $schedule->command('notice:fpdx c')->between('8:00', '22:00')->everyMinute();
  108. ## 72小时活动
  109. // 分配对象预匹配
  110. $schedule->command('pair:prepipei')->wednesdays()->at('12:30');
  111. // 每周创建活动
  112. $schedule->command('pair:activity')->thursdays()->at('12:00');
  113. // 对象匹配
  114. $schedule->command('pair:pipei')->thursdays()->at('12:10');
  115. // 匹配通知
  116. $schedule->command('pair:notice:pair')->thursdays()->at('12:20');
  117. // 匹配修改状态
  118. $schedule->command('pair:publish')->thursdays()->at('17:01');
  119. // 送入群聊
  120. $schedule->command('pair:into:group')->thursdays()->at('17:02');
  121. // 情报局送入房间
  122. $schedule->command('qbj:into:room')->thursdays()->at("17:03");
  123. // 分配对象:重新匹配
  124. $schedule->command('pair:rematch')->fridays()->at('10:10');
  125. // 重匹通知
  126. $schedule->command('pair:notice:rematch')->fridays()->at('10:20');
  127. // 创群创房间
  128. $schedule->command('pair:into:room')->fridays()->at("11:01");
  129. $schedule->command('pair:into:group')->fridays()->at("11:02");
  130. // 活动结束分销
  131. $schedule->command('pair:account')->mondays()->at('00:10');
  132. // 反馈通知
  133. $schedule->command('pair:notice:feedback')->mondays()->at('00:20');
  134. }
  135. /**
  136. * Register the Closure based commands for the application.
  137. *
  138. * @return void
  139. */
  140. protected function commands()
  141. {
  142. $this->load(__DIR__ . '/Commands');
  143. $this->load(__DIR__ . '/Commands/Pair');
  144. $this->load(__DIR__ . '/Commands/Partner');
  145. $this->load(__DIR__ . '/Commands/Cache');
  146. $this->load(__DIR__ . '/Commands/Welfare');
  147. $this->load(__DIR__ . '/Commands/Wechat');
  148. $this->load(__DIR__ . '/Commands/Goodnight');
  149. $this->load(__DIR__ . '/Commands/Upgrade');
  150. $this->load(__DIR__ . '/Commands/User');
  151. $this->load(__DIR__ . '/Commands/Notices');
  152. $this->load(__DIR__ . '/Commands/Exports');
  153. $this->load(__DIR__ . '/Commands/MeiTu');
  154. require base_path('routes/console.php');
  155. }
  156. }