From 358bc3e098253f4c2a32e013e5f601b0d8790875 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 21 Dec 2023 09:58:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=AE=89=E6=8E=92-=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=BC=80=E5=A7=8B=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/TaskController.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/api/controller/TaskController.php b/app/api/controller/TaskController.php index 7e3343c31..500dfdf70 100644 --- a/app/api/controller/TaskController.php +++ b/app/api/controller/TaskController.php @@ -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('成功', []); + } + } }