diff --git a/application/api/controller/Calendar.php b/application/api/controller/Calendar.php index a4876a06..53995173 100644 --- a/application/api/controller/Calendar.php +++ b/application/api/controller/Calendar.php @@ -30,16 +30,18 @@ class Calendar extends ApiBase ->where('oe.date', '>=', $startDate) ->where('oe.date', '<=', $endDate) ->where('oe.abnormal', 0) - ->where('s.onwork', 1) - ->where('s.leave', 1) - ->where('oe.staff_id', '<>', null) - ->field('oe.date,oe.addtime,oe.start_time,oe.timeout,oe.xq,oe.staff_id,s.name as staff_name,g.name as goods_name') + ->field('oe.staff_status,oe.date,oe.addtime,oe.start_time,oe.timeout,oe.xq,oe.staff_id,s.name as staff_name,s.onwork,s.leave,g.name as goods_name') ->order('oe.date asc, oe.addtime asc') ->select(); $serviceDate = []; if ($service) { foreach ($service as $v) { + // 如果有绑定员工,但员工状态不符合要求,则跳过 + if (!empty($v['staff_id']) && ($v['onwork'] != 1 || $v['leave'] != 1)) { + continue; + } + // 处理服务时间 $timeRange = ''; if (!empty($v['start_time']) && !empty($v['timeout'])) { @@ -56,6 +58,7 @@ class Calendar extends ApiBase } $serviceDate[] = [ + 'staff_status' => $v['staff_status'], 'date' => $v['date'], 'staff_name' => $v['staff_name'] ?? '', 'goods_name' => $v['goods_name'] ?? '', diff --git a/application/api/controller/Help.php b/application/api/controller/Help.php index a6dcc754..fdea9f15 100644 --- a/application/api/controller/Help.php +++ b/application/api/controller/Help.php @@ -49,4 +49,12 @@ class Help extends ApiBase $this->_success('获取成功', $help_detail); } + //查询承诺 + public function commitment() + { + $help = new HelpLogic(); + $commitment = $help->commitmentInfo(); + $this->_success('获取成功', $commitment); + } + } \ No newline at end of file diff --git a/application/api/logic/HelpLogic.php b/application/api/logic/HelpLogic.php index 492eacc7..a3ee0782 100644 --- a/application/api/logic/HelpLogic.php +++ b/application/api/logic/HelpLogic.php @@ -106,4 +106,11 @@ class HelpLogic return $res; } + + + public function commitmentInfo() + { + $data = Db::name('help')->where('title','承诺')->field('id,title,content')->find(); + return $data; + } } \ No newline at end of file diff --git a/application/api/logic/OrderLogic.php b/application/api/logic/OrderLogic.php index a8f5eae9..1aeaef65 100644 --- a/application/api/logic/OrderLogic.php +++ b/application/api/logic/OrderLogic.php @@ -1137,6 +1137,7 @@ class OrderLogic extends LogicBase $list['orderyjfw']= $list['number']-$number; $list['orderdaifw'] = Db::name('order_exe')->where('order_sn',$list['order_sn'])->where('staff_status',0)->count(); //待服务数量 $list['orderfwzhon'] = Db::name('order_exe')->where('order_sn',$list['order_sn'])->where('staff_status',1)->count(); //服务中数量 + $list['orderyiwanchen'] = Db::name('order_exe')->where('order_sn',$list['order_sn'])->where('staff_status',3)->count(); //服务已完成 $list['showBubble']=false; $list['more']="更多"; }