diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index 0ce42cbf..d29c6ddd 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -34,7 +34,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte public function setSearch(): array { return [ - '=' => ['store_id', 'paid', 'status', 'order_type', 'admin_id'], + '=' => ['id', 'store_id', 'paid', 'status', 'order_type', 'admin_id'], '%like' => ['order_id','order_sn'], '%like%' => ['mark'], 'between_time' => 'create_time' diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 9e9e5bb9..4f7c1b27 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -76,6 +76,10 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe $this->searchWhere[] = ['product_id', 'in', $ids]; } } + if (!empty($this->params['store_id'])) { + $orderIds = BeforehandOrder::where('store_id', $this->params['store_id'])->column('id'); + $this->searchWhere[] = ['bhoid', 'in', $orderIds]; + } $list = BeforehandOrderCartInfo::where($this->searchWhere) ->field(['id', 'bhoid', 'package', 'store_info', 'marques', 'gross_weight', 'net_weight', 'accept_num', 'after_sales', 'loss', 'uid', 'pay_price', 'is_buyer', 'buyer_uid', 'product_id', 'attr_value_id', 'purchase', 'price', 'total_price', 'cart_num', 'mark','create_time', 'procurement_order_id', 'store_sale']) ->limit($this->limitOffset, $this->limitLength) @@ -137,6 +141,10 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe */ public function count(): int { + if (!empty($this->params['store_id'])) { + $orderIds = BeforehandOrder::where('store_id', $this->params['store_id'])->column('id'); + $this->searchWhere[] = ['bhoid', 'in', $orderIds]; + } return BeforehandOrderCartInfo::where($this->searchWhere)->count(); } diff --git a/app/admin/lists/warehouse_product/WarehouseProductLists.php b/app/admin/lists/warehouse_product/WarehouseProductLists.php index f724caaf..333a0bd7 100644 --- a/app/admin/lists/warehouse_product/WarehouseProductLists.php +++ b/app/admin/lists/warehouse_product/WarehouseProductLists.php @@ -76,9 +76,12 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt } $query = WarehouseProduct::where($this->searchWhere); if (isset($this->params['is_group']) && $this->params['is_group'] == 1) { - $query->group('product_id')->field(['id', 'code','pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'sum(nums) nums', 'price', 'purchase', 'cost', 'sum(total_price) total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay', 'order_type','vip_price']); + $query->group('product_id')->field(['id', 'code','pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'sum(nums) nums', 'price', 'purchase', 'cost', 'sum(total_price) total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay', 'order_type','vip_price', 'delete_time']); } else { - $query->field(['id', 'code','pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'nums', 'price', 'purchase', 'cost', 'total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay', 'order_type','vip_price']); + $query->field(['id', 'code','pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'nums', 'price', 'purchase', 'cost', 'total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay', 'order_type','vip_price', 'delete_time']); + } + if (!empty($this->params['product_status'])) { + $query->onlyTrashed(); } return $query ->limit($this->limitOffset, $this->limitLength) @@ -168,10 +171,14 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt */ public function count(): int { + $query = WarehouseProduct::where($this->searchWhere); + if (!empty($this->params['product_status'])) { + $query->onlyTrashed(); + } if ($this->ids) { - return WarehouseProduct::whereIn('id', $this->ids)->where($this->searchWhere)->count(); + return $query->whereIn('id', $this->ids)->count(); } else { - return WarehouseProduct::where($this->searchWhere)->count(); + return $query->count(); } } /**