From c12a519bcd18f360d15bc2890156a04b8c6214d2 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Tue, 14 Jan 2025 11:38:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=B9=E9=87=8F=E5=85=A5?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system_store_storage/SystemStoreStorageController.php | 3 ++- .../lists/store_branch_product/StoreBranchProductLists.php | 1 + .../logic/system_store_storage/SystemStoreStorageLogic.php | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/admin/controller/system_store_storage/SystemStoreStorageController.php b/app/admin/controller/system_store_storage/SystemStoreStorageController.php index a243014d4..c584b8c19 100644 --- a/app/admin/controller/system_store_storage/SystemStoreStorageController.php +++ b/app/admin/controller/system_store_storage/SystemStoreStorageController.php @@ -99,7 +99,8 @@ class SystemStoreStorageController extends BaseAdminController */ public function batchConfirm() { - SystemStoreStorageLogic::editAll([], $this->adminId); + $params = $this->request->post(); + SystemStoreStorageLogic::editAll($params, $this->adminId); return $this->success('操作成功',[]); } diff --git a/app/admin/lists/store_branch_product/StoreBranchProductLists.php b/app/admin/lists/store_branch_product/StoreBranchProductLists.php index adf157c90..906db345e 100644 --- a/app/admin/lists/store_branch_product/StoreBranchProductLists.php +++ b/app/admin/lists/store_branch_product/StoreBranchProductLists.php @@ -152,6 +152,7 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI { $data = [ 'product_id' => '商品ID', + 'system_store_name' => '门店', 'store_name' => '商品名称', 'store_info' => '规格', 'unit_name' => '单位', diff --git a/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php b/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php index a98d38016..3ee63283c 100644 --- a/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php +++ b/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php @@ -96,9 +96,13 @@ class SystemStoreStorageLogic extends BaseLogic public static function editAll(array $params, $adminId = 0): bool { $where = ['status' => 0]; - if (isset($params['store_id'])) { + if (!empty($params['store_id'])) { $where['store_id'] = $params['store_id']; } + if (!empty($params['product_name'])) { + $productIds = StoreProduct::where('store_name', 'like', '%' . $params['product_name'] . '%')->column('id'); + $where[] = ['product_id', 'in', $productIds]; + } $list = SystemStoreStorage::where($where)->column('id'); foreach ($list as $item) { $params['id'] = $item;