course/process/Task.php

27 lines
663 B
PHP
Raw Normal View History

2024-08-04 22:28:52 +08:00
<?php
namespace process;
2024-08-29 23:22:32 +08:00
use app\common\service\SendMsgCronJobService;
2024-08-04 22:28:52 +08:00
use Workerman\Crontab\Crontab;
class Task
{
public function onWorkerStart()
{
2024-08-04 23:31:50 +08:00
2024-08-04 22:28:52 +08:00
// 每天的7点50执行注意这里省略了秒位
new Crontab('50 7 * * *', function(){
//上课前一天提醒教师、学生、家长
2024-10-09 09:46:07 +08:00
(new SendMsgCronJobService())->classBeginSingleMsgToTeacher();
2024-08-04 22:28:52 +08:00
});
// 每分钟执行一次
new Crontab('0 */1 * * * *', function(){
//上课前10分钟提醒教师、学生、家长
(new SendMsgCronJobService())->classBeginMsgToMsgBeforeTenMinute();
});
2024-08-04 22:28:52 +08:00
}
}