userId); return $this->success('操作成功', $data, 1, 0); } public function lists() { return $this->dataLists(new MasterWorkerMessageLists()); } public function showMsg() { $validate = \think\facade\Validate::rule([ 'ids' => 'require|array', 'msg_type' => 'require' ]); if (!$validate->check(request()->all())) { return $this->fail($validate->getError()); } MasterWorkerMessageLogic::showMsg(request()->all(),$this->userId); return $this->success('操作成功', [], 1, 0); } /** * 工程师接单提示 * @return \think\response\Json */ public function orderPrompt() { $result = ['confirm_code'=>0,'msg'=>'无']; $prompt_result = MasterWorkerMessageLogic::orderPrompt($this->userId); //检测是否开启接单 $master_worker = MasterWorker::where('id',$this->userId)->findOrEmpty(); if(!$master_worker->isEmpty() && $master_worker['accept_order_status'] == 0){ $result = ['confirm_code'=>103,'msg'=>'您已关闭接单,如需接单,请先开启接单']; return $this->success('操作成功', $result, 1, 0); } //新工单领取 if(!empty($prompt_result)){ $result = ['confirm_code'=>101,'msg'=>'您有新的工单未领取,请点击领取','data'=>$prompt_result]; return $this->success('操作成功', $result, 1, 0); } //预约时间更新确认 $appoint_result = ServiceWorkLogic::getAppointmentNotice($this->userId); if(!empty($appoint_result)){ $result = ['confirm_code'=>102,'msg'=>'您有工单更改了预约时间,请注意查看','data'=>$appoint_result]; return $this->success('操作成功', $result, 1, 0); } return $this->success('操作成功', $result, 1, 0); } }