|
@@ -120,9 +120,7 @@ class MasterService extends BaseService
|
|
|
$info['description_text'] = $info['description']? str_replace("\n","<br>", $info['description']) : '';
|
|
$info['description_text'] = $info['description']? str_replace("\n","<br>", $info['description']) : '';
|
|
|
|
|
|
|
|
// 评分
|
|
// 评分
|
|
|
- $score = MasterAdviceModel::where(['master_uid'=> $uid,'status'=> 1,'pid'=> 0])
|
|
|
|
|
- ->select(\DB::raw("sum('score')/count('id') as score"))
|
|
|
|
|
- ->get();
|
|
|
|
|
|
|
+ $score = MasterAdviceModel::where(['master_uid'=> $uid,'status'=> 1,'pid'=> 0])->avg('score');
|
|
|
$info['score'] = $score? $score : 0;
|
|
$info['score'] = $score? $score : 0;
|
|
|
|
|
|
|
|
// 是否评分过
|
|
// 是否评分过
|