From 6926137b5efc1b22c07e5e6b710c50f8d525ce9d Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Mon, 13 Mar 2023 14:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E8=AF=84=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/PatientDoctorController.php | 11 +++++ app/Services/PatientDoctorService.php | 48 ++++++++++++++++++++++ app/Services/PatientOrderService.php | 1 - config/routes.php | 5 ++- 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/app/Controller/PatientDoctorController.php b/app/Controller/PatientDoctorController.php index 5764ecb..856ac04 100644 --- a/app/Controller/PatientDoctorController.php +++ b/app/Controller/PatientDoctorController.php @@ -84,4 +84,15 @@ class PatientDoctorController extends AbstractController $data = $PatientDoctorService->getDoctorList(); return $this->response->json($data); } + + /** + * 获取医生评价 + * @return ResponseInterface + */ + public function getDoctorEvaluationList(): ResponseInterface + { + $PatientDoctorService = new PatientDoctorService(); + $data = $PatientDoctorService->getDoctorEvaluationList(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index 12f58e7..fcdbbd5 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -183,6 +183,7 @@ class PatientDoctorService extends BaseService "is_img_welfare_reception", "is_platform_deep_cooperation", "be_good_at", + "brief_introduction", ]; $params = array(); @@ -249,6 +250,26 @@ class PatientDoctorService extends BaseService $params[] = ['inquiry_status', '=', 3]; $params[] = ['inquiry_refund_status', '=', 0]; $value['order_inquiry_count'] = OrderInquiry::getCount($params); + + // 获取系统问诊配置 + $fields = [ + 'system_inquiry_config_id', + 'times_number', + 'duration', + ]; + + $params = array(); + $params['inquiry_type'] = $value['inquiry_type']; + $params['inquiry_mode'] = $value['inquiry_mode']; + $system_inquiry_config = SystemInquiryConfig::getOne($params,$fields); + if (empty($system_inquiry_config)){ + return fail(); + } + + $value['times_number'] = $system_inquiry_config['times_number']; + $value['duration'] = $system_inquiry_config['duration']; + + unset($system_inquiry_config); } $result['doctor_inquiry_config'] = $doctor_inquiry_config; } @@ -527,6 +548,33 @@ class PatientDoctorService extends BaseService return success($results); } + /** + * 获取医生评价 + * @return array + */ + public function getDoctorEvaluationList(): array + { + $user_info = $this->request->getAttribute("userInfo") ?? []; + + $doctor_id = $this->request->route('doctor_id'); + $page = $this->request->input('page', 1); + $per_page = $this->request->input('per_page', 10); + + $params = array(); + $params['doctor_id'] = $doctor_id; + + $order_evaluation = OrderEvaluation::getPage($params, ['*'],$page,$per_page); + if (!empty($order_evaluation['data'])) { + foreach ($order_evaluation['data'] as &$item) { + $item['reply_quality'] = floor($item['reply_quality'] * 0.05); + $item['service_attitude'] = floor($item['service_attitude'] * 0.05); + $item['reply_progress'] = floor($item['reply_progress'] * 0.05); + $item['avg_score'] = floor($item['avg_score'] * 0.05); + } + } + return success($order_evaluation); + } + /** * 获取首页服务过患者的医生 * 限制条数 diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index c7bd541..9d607a3 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -770,7 +770,6 @@ class PatientOrderService extends BaseService /** * 获取处方订单支付页详情 - * 我这边一直到6-7月份才能走得开。目前这几个月项目都正在开发中,没办法离开,也不好。 * @return array */ public function getPatientPrescriptionOrderPayInfo(): array diff --git a/config/routes.php b/config/routes.php index 160603b..66a8080 100644 --- a/config/routes.php +++ b/config/routes.php @@ -217,7 +217,7 @@ Router::addGroup('/patient', function () { // 获取医生详情-问诊 Router::get('/{doctor_id:\d+}', [PatientDoctorController::class, 'getInquiryDoctorInfo']); - // 医生详情简介-详情中的简介 + // 医生详情简介-详情中的简介-废弃 Router::get('/profile/{doctor_id:\d+}', [PatientDoctorController::class, 'getDoctorProfile']); // 删除服务过患者的医生 @@ -225,6 +225,9 @@ Router::addGroup('/patient', function () { // 获取我的问诊、关注医生列表 Router::get('/my', [PatientDoctorController::class, 'getDoctorList']); + + // 获取医生评价 + Router::get('/evaluation/{doctor_id:\d+}', [PatientDoctorController::class, 'getDoctorEvaluationList']); }); // 家庭成员