From e658c2a0fd38281cd41af046784d52a8a89ba090 Mon Sep 17 00:00:00 2001 From: gitfjn <2860488097@qq.com> Date: Thu, 8 Jan 2026 17:55:47 +0400 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Calendar.php | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 application/api/controller/Calendar.php diff --git a/application/api/controller/Calendar.php b/application/api/controller/Calendar.php new file mode 100644 index 00000000..e849f3e0 --- /dev/null +++ b/application/api/controller/Calendar.php @@ -0,0 +1,43 @@ +request->post("date"); + if (!$date) { + return $this->_error("日期不能为空"); + } + //查询这个时间的服务 + $service = Db::name('order_exe')->where('date', $date)->where('abnormal', 0)->select(); + $serviceDate = []; + if ($service) { + //查询到有数据,就去找服务人员 + foreach ($service as $v) { + if ($v['staff_id'] != null) { + $staffName = Db::name('staff')->where('id', $v['staff_id']) + ->where('onwork', 1) + ->where('leave', 1) + ->find(); + if ($staffName){ + $startTime = date('H:i', strtotime($v['start_time'])); + $timeoutTime = date('H:i', strtotime($v['timeout'])); + $timeRange = $startTime . '-' . $timeoutTime; + $serviceDate[] = [ + 'date' => $v['date'], + 'staff_name' => $staffName['name'], + 'addtime' => $v['addtime'] == 1 ? '上午' : ($v['addtime'] == 2 ? '下午' : ''), //1表示上午,2表示下午 + 'serviceTime' => $timeRange, + 'xq' => $v['xq'], + ]; + } + } + } + } + return $this->_success("成功", $serviceDate); + } +} \ No newline at end of file