diff --git a/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php b/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php index 474af6944..3622c5dbb 100644 --- a/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php +++ b/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php @@ -92,6 +92,15 @@ class SystemStoreStorageLogic extends BaseLogic } } + public static function editAll(array $params): bool + { + $list = SystemStoreStorage::where(['store_id' => $params['store_id'], 'status' => 0])->column('id'); + foreach ($list as $item) { + $params['id'] = $item; + self::edit($params); + } + return true; + } /** * @notes 删除门店入库记录 diff --git a/app/store/controller/system_store_storage/SystemStoreStorageController.php b/app/store/controller/system_store_storage/SystemStoreStorageController.php index 9acddf095..8507fb3a3 100644 --- a/app/store/controller/system_store_storage/SystemStoreStorageController.php +++ b/app/store/controller/system_store_storage/SystemStoreStorageController.php @@ -42,5 +42,11 @@ class SystemStoreStorageController extends BaseAdminController return $this->success('操作成功'); } + public function editAll() + { + $storeId = $this->request->adminInfo['store_id'] ?? 0; + SystemStoreStorageLogic::editAll(['staff_id'=>$this->adminId,'admin_id'=>0, 'store_id'=>$storeId]); + return $this->success('操作成功'); + } } \ No newline at end of file