获取医生评价修改
This commit is contained in:
parent
8ea6d79459
commit
0e7c6bba47
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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']);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user