course/process/Task.php

27 lines
666 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace process;
use app\common\service\SendMsgCronJobService;
use Workerman\Crontab\Crontab;
class Task
{
public function onWorkerStart()
{
// 每天的7点50执行注意这里省略了秒位
new Crontab('50 7 * * *', function(){
//上课前一天提醒教师、学生、家长
(new SendMsgCronJobService())->classBeginMsgToTeacherBeforeDay();
});
// 每分钟执行一次
new Crontab('0 */1 * * * *', function(){
//上课前10分钟提醒教师、学生、家长
(new SendMsgCronJobService())->classBeginMsgToMsgBeforeTenMinute();
});
}
}