post()->goCheck('confirmDoor'); try { $work_sn = decrypt($params['code'], \think\facade\Config::get('project.work_sn_key')); $work = ServiceWork::where(['work_sn'=>$work_sn,'mobile'=>$params['phone']])->findOrEmpty(); if($work->isEmpty()){ throw new Exception('工单不存在'); } $params['user_id'] = $work['master_worker_id'];//工程师信息 $params['user_info'] = MasterWorker::where('id',$work['master_worker_id'])->field('worker_number,real_name')->findOrEmpty();//工程师信息 $params['work_sn'] = $work_sn; $result = ServiceWorkLogic::confirmDoor($params); if (false === $result) { throw new Exception(ServiceWorkLogic::getError()); } }catch (\Exception $e){ return $this->fail($e->getMessage()); } return $this->success('已确认上门'); } }