商品评论有哈

feat/task1-c-wallet
Devil 2021-07-23 19:21:03 +08:00
parent 9c78d09759
commit c112313962
1 changed files with 1 additions and 1 deletions

View File

@ -570,7 +570,7 @@ class GoodsCommentsService
['goods_id', '=', $goods_id],
['rating', '>', 0],
];
$data = Db::name('GoodsComments')->where($where)->group('rating')->column('count(*) as count, rating', 'rating');
$data = Db::name('GoodsComments')->where($where)->group('rating')->column('count(*) as count', 'rating');
if(!empty($data))
{
$sum = array_sum($data);