任务安排-任务开始提示

This commit is contained in:
chenbo 2023-12-21 09:58:45 +08:00
parent e57e7052e9
commit 358bc3e098

View File

@ -20,7 +20,6 @@ use think\facade\Db;
class TaskController extends BaseApiController
{
public function lists()
{
$param = Request()->param();
@ -996,4 +995,22 @@ class TaskController extends BaseApiController
}
}
// 任务开始通知
public function taskStartNotice()
{
$startTime = strtotime(date('Y-m-d', time()));
$endTime = strtotime(date('Y-m-d', strtotime('+2 day')));
// 查询用户所在公司的任务安排
$template = TaskTemplate::where('company_id', $this->userInfo['company_id'])
->whereBetweenTime('cron_time', $startTime, $endTime)
->order('cron_time', 'asc')
->find();
if (!empty($template)) {
$template['cron_time'] = date('Y-m-d', $template['cron_time']);
return $this->success('成功', compact('template'));
} else {
return $this->success('成功', []);
}
}
}