|
|
@@ -63,6 +63,7 @@ class CartService extends BaseService
|
|
|
$query = $this->getQuery($params)
|
|
|
->orderBy('a.create_time', 'desc')
|
|
|
->orderBy('a.id', 'desc');
|
|
|
+ $count = $query->count('a.id');
|
|
|
|
|
|
$field = ["a.*"];
|
|
|
$list = $query->select($field)
|
|
|
@@ -73,6 +74,7 @@ class CartService extends BaseService
|
|
|
$datas = [
|
|
|
'pageSize' => $pageSize,
|
|
|
'total' => isset($list['total']) ? $list['total'] : 0,
|
|
|
+ 'count' => $count,
|
|
|
'list' => isset($list['data']) ? $list['data'] : []
|
|
|
];
|
|
|
|
|
|
@@ -100,7 +102,6 @@ class CartService extends BaseService
|
|
|
}
|
|
|
|
|
|
$model = $this->model->with(['store','cartGoods'])
|
|
|
- ->withCount(['cartGoods'])
|
|
|
->from('carts as a')
|
|
|
->leftJoin('goods as b', 'b.id', '=', 'a.goods_id')
|
|
|
->where($where)
|