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']);