feat: 移除购物车和订单统计中的withTrashed方法

This commit is contained in:
mkm 2024-08-26 17:20:56 +08:00
parent edf4c74308
commit 727a091c5a
2 changed files with 2 additions and 3 deletions

View File

@ -74,7 +74,6 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
foreach ($list as $key => &$item) {
$find = StoreBranchProduct::where(['product_id' => $item['product_id'], 'store_id' => $item['store_id']])
->field($field)
->withTrashed()
->find();
if ($find) {
if ($off_activity == 1) {

View File

@ -372,8 +372,8 @@ class WorkbenchLogic extends BaseLogic
$dateDiff = (new \DateTime($endTime))->diff(new \DateTime($startTime));
$data['visit_count'] = StoreVisit::where('store_id', $storeId)->whereBetweenTime('create_time', $startTime, $endTime)->count();
$data['visit_user_count'] = StoreVisit::where('store_id', $storeId)->whereBetweenTime('create_time', $startTime, $endTime)->group('uid')->count();
$data['add_cart_count'] = Cart::where('store_id', $storeId)->whereBetweenTime('create_time', $startTime, $endTime)->withTrashed()->group('product_id')->count();
$data['add_order_count'] = StoreOrderCartInfo::where('store_id', $storeId)->whereBetweenTime('create_time', $startTime, $endTime)->withTrashed()->group('product_id')->count();
$data['add_cart_count'] = Cart::where('store_id', $storeId)->whereBetweenTime('create_time', $startTime, $endTime)->group('product_id')->count();
$data['add_order_count'] = StoreOrderCartInfo::where('store_id', $storeId)->whereBetweenTime('create_time', $startTime, $endTime)->group('product_id')->count();
$data['pay_count'] = StoreOrder::alias('t1')
->join('store_order_cart_info t2', 't1.id = t2.oid')
->where('t1.store_id', $storeId)