course/process/Task.php

27 lines
666 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执行注意这里省略了秒位
2024-11-04 09:40:47 +08:00
new Crontab('0 10 * * *', function(){
//上课前一天提醒教师、学生、家长
(new SendMsgCronJobService())->classBeginMsgToTeacherBeforeDay();
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
}
}