request->get('patient_id'); if (!$patientId) { return $this->fail('患者ID不能为空'); } // 调用逻辑层 $result = DiagnosisLogic::getPatientSignature($patientId); if ($result === false) { return $this->fail(DiagnosisLogic::getError()); } return $this->data($result); } /** * @notes 获取诊单详情(供小程序调用) * @return \think\response\Json */ public function diagnosisDetail() { $id = $this->request->get('id'); if (!$id) { return $this->fail('诊单ID不能为空'); } try { $result = DiagnosisLogic::detail(['id' => $id]); return $this->data($result); } catch (\Exception $e) { return $this->fail($e->getMessage()); } } /** * @notes 获取字典数据(供小程序调用) * @return \think\response\Json */ public function getDict() { $type = $this->request->get('type', ''); if (!$type) { return $this->fail('字典类型不能为空'); } try { $data = ConfigLogic::getDictByType($type); return $this->data($data); } catch (\Exception $e) { return $this->fail($e->getMessage()); } } }