This commit is contained in:
Your Name
2026-03-16 15:08:28 +08:00
parent 294fee4d88
commit cda63b5ae2
26 changed files with 1695 additions and 492 deletions
+19 -1
View File
@@ -11,7 +11,7 @@ use app\api\logic\DoctorLogic;
*/
class DoctorController extends BaseApiController
{
public array $notNeedLogin = ['lists', 'detail'];
public array $notNeedLogin = ['lists', 'detail', 'reviews'];
/**
* @notes 获取医生列表
@@ -70,4 +70,22 @@ class DoctorController extends BaseApiController
$result = DoctorLogic::getDoctorRoster($doctorId, $date);
return $this->success('', $result);
}
/**
* @notes 获取医生评价列表
* @return \think\response\Json
*/
public function reviews()
{
$doctorId = $this->request->get('doctor_id', 0);
$pageNo = $this->request->get('page_no', 1);
$pageSize = $this->request->get('page_size', 10);
if (!$doctorId) {
return $this->fail('医生ID不能为空');
}
$result = DoctorLogic::getDoctorReviews($doctorId, $pageNo, $pageSize);
return $this->success('', $result);
}
}
@@ -155,6 +155,74 @@ class TcmController extends BaseApiController
}
}
/**
* @notes 新建就诊卡(供小程序调用)
* @return \think\response\Json
*/
public function addCard()
{
$params = [
'user_id' => $this->userId,
'patient_id' => $this->request->post('patient_id'),
'patient_name' => $this->request->post('patient_name'),
'gender' => $this->request->post('gender'),
'age' => $this->request->post('age'),
'id_card' => $this->request->post('id_card'),
'height' => $this->request->post('height'),
'weight' => $this->request->post('weight'),
'systolic_pressure' => $this->request->post('systolic_pressure'),
'diastolic_pressure' => $this->request->post('diastolic_pressure'),
'fasting_blood_sugar' => $this->request->post('fasting_blood_sugar'),
'diabetes_discovery_year' => $this->request->post('diabetes_discovery_year'),
'local_hospital_diagnosis' => $this->request->post('local_hospital_diagnosis'),
'local_hospital_name' => $this->request->post('local_hospital_name'),
'local_hospital_visit_date' => $this->request->post('local_hospital_visit_date'),
'diagnosis_date' => $this->request->post('diagnosis_date'),
'diagnosis_type' => $this->request->post('diagnosis_type'),
'syndrome_type' => $this->request->post('syndrome_type'),
'diabetes_type' => $this->request->post('diabetes_type'),
'appetite' => $this->request->post('appetite'),
'water_intake' => $this->request->post('water_intake'),
'diet_condition' => $this->request->post('diet_condition'),
'weight_change' => $this->request->post('weight_change'),
'body_feeling' => $this->request->post('body_feeling'),
'sleep_condition' => $this->request->post('sleep_condition'),
'eye_condition' => $this->request->post('eye_condition'),
'head_feeling' => $this->request->post('head_feeling'),
'sweat_condition' => $this->request->post('sweat_condition'),
'skin_condition' => $this->request->post('skin_condition'),
'urine_condition' => $this->request->post('urine_condition'),
'stool_condition' => $this->request->post('stool_condition'),
'kidney_condition' => $this->request->post('kidney_condition'),
'fatty_liver_degree' => $this->request->post('fatty_liver_degree'),
'past_history' => $this->request->post('past_history'),
'trauma_history' => $this->request->post('trauma_history'),
'surgery_history' => $this->request->post('surgery_history'),
'allergy_history' => $this->request->post('allergy_history'),
'family_history' => $this->request->post('family_history'),
'pregnancy_history' => $this->request->post('pregnancy_history'),
'symptoms' => $this->request->post('symptoms'),
'tongue_coating' => $this->request->post('tongue_coating'),
'tongue_images' => $this->request->post('tongue_images'),
'report_files' => $this->request->post('report_files'),
'pulse' => $this->request->post('pulse'),
'treatment_principle' => $this->request->post('treatment_principle'),
'prescription' => $this->request->post('prescription'),
'doctor_advice' => $this->request->post('doctor_advice'),
'remark' => $this->request->post('remark')
];
// patient_id 可选:不传则创建时自动生成(新患者首张就诊卡)
try {
$result = DiagnosisLogic::addCard($params);
if ($result === false) {
return $this->fail(DiagnosisLogic::getError());
}
return $this->success('创建成功', $result);
} catch (\Exception $e) {
return $this->fail($e->getMessage());
}
}
/**
* @notes 更新就诊卡(供小程序调用)
* @return \think\response\Json