From 0e7c6bba47b0cb2874d7d74ae33d5072ebef2648 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Fri, 1 Mar 2024 14:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8C=BB=E7=94=9F=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/UserDoctorService.php | 23 ++++++++++++++++++++--- config/routes.php | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index b445da6..8a9990d 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -745,9 +745,6 @@ class UserDoctorService extends BaseService return fail(); } - $params = array(); - $params['doctor_id'] = $doctor_id; - // 4-5分为好评、3分为中评、2-1分为差评 if ($evaluation_type == 1) { // 全部 @@ -762,6 +759,8 @@ class UserDoctorService extends BaseService return fail(); } + $params = array(); + $params['doctor_id'] = $doctor_id; $order_evaluation = OrderEvaluation::getScorePage($params, $avg_score_params,['*'],$page,$per_page); if (!empty($order_evaluation['data'])) { foreach ($order_evaluation['data'] as &$item) { @@ -785,20 +784,32 @@ class UserDoctorService extends BaseService if ($evaluation_type == 1) { // 好评 $avg_score_params = [80, 100]; + + $params = array(); + $params['doctor_id'] = $doctor_id; $good_quantity = OrderEvaluation::getScoreCount($params, $avg_score_params); // 中/差评 $avg_score_params = [0, 79]; + + $params = array(); + $params['doctor_id'] = $doctor_id; $bad_quantity = OrderEvaluation::getScoreCount($params, $avg_score_params); } if ($evaluation_type == 2) { // 全部+ $avg_score_params = [0, 100]; + + $params = array(); + $params['doctor_id'] = $doctor_id; $total_quantity = OrderEvaluation::getScoreCount($params, $avg_score_params); // 中/差评 $avg_score_params = [0, 79]; + + $params = array(); + $params['doctor_id'] = $doctor_id; $bad_quantity = OrderEvaluation::getScoreCount($params, $avg_score_params); } @@ -806,10 +817,16 @@ class UserDoctorService extends BaseService if ($evaluation_type == 3) { // 全部+ $avg_score_params = [0, 100]; + + $params = array(); + $params['doctor_id'] = $doctor_id; $total_quantity = OrderEvaluation::getScoreCount($params, $avg_score_params); // 好评 $avg_score_params = [80, 100]; + + $params = array(); + $params['doctor_id'] = $doctor_id; $good_quantity = OrderEvaluation::getScoreCount($params, $avg_score_params); } diff --git a/config/routes.php b/config/routes.php index b328481..a682fbd 100644 --- a/config/routes.php +++ b/config/routes.php @@ -799,7 +799,7 @@ Router::addGroup('/test', function () { Router::get('', [TestController::class, 'test_17']); // - Router::get('/uninquiry', [TestController::class, 'uninquiry']); +// Router::get('/uninquiry', [TestController::class, 'uninquiry']); // 模拟退款 // Router::get('/refund', [TestController::class, 'refund']);