jason 5 сар өмнө
parent
commit
278e2f2e73

+ 7 - 1
app/admin/controller/shop/ShopDelivery.php

@@ -46,7 +46,13 @@ class ShopDelivery extends Backend
             ->paginate($limit);
 
         //表格底部要有汇总:发货数量汇总  重量汇总 总价汇总
-        $count = $this->model->withJoin($with,'left')->where($where)->field('sum(num) total_num, sum(weigh) total_weigh, sum(total_price) total_price')->select()->toArray();
+        $count = $this->model
+            ->withJoin($with,'left')
+            ->where($where)
+            ->field('sum(num) total_num, sum(weigh) total_weigh, sum(total_price) total_price')
+            ->group('shop_delivery.id')
+            ->select()
+            ->toArray();
 
         $result = ['total' => $list->total(), 'rows' => $list->items(), 
         'total_num'    => $count[0]['total_num']??0,