From f5185ea3773c6738bed33081fe62a1d8c637a89a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 8 Jun 2024 21:33:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(system=5Fstore=5Fstorage):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BC=96=E8=BE=91=E5=BA=93=E5=AD=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SystemStoreStorageController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/store/controller/system_store_storage/SystemStoreStorageController.php b/app/store/controller/system_store_storage/SystemStoreStorageController.php index ef3f1c0e2..eaaf67ae3 100644 --- a/app/store/controller/system_store_storage/SystemStoreStorageController.php +++ b/app/store/controller/system_store_storage/SystemStoreStorageController.php @@ -7,6 +7,8 @@ use app\store\controller\BaseAdminController; use app\store\lists\system_store_storage\SystemStoreStorageLists; use app\admin\logic\system_store_storage\SystemStoreStorageLogic; use app\admin\validate\system_store_storage\SystemStoreStorageValidate; +use app\common\model\store_branch_product\StoreBranchProduct; +use app\common\model\system_store_storage\SystemStoreStorage; use hg\apidoc\annotation as ApiDoc; @@ -30,6 +32,20 @@ class SystemStoreStorageController extends BaseAdminController return $this->dataLists(new SystemStoreStorageLists()); } + public function edit() + { + $id = $this->request->post('id',0); + if($id==0){ + return $this->fail('参数错误'); + } + $res=SystemStoreStorage::where(['id' => $id,'store_id'=>$this->adminInfo['store_id']])->update(['status'=>1,'staff_id'=>$this->adminId]); + if($res){ + $find=SystemStoreStorage::where(['id' => $id])->find(); + StoreBranchProduct::where(['product_id'=>$find['product_id'],'store_id'=>$find['store_id']])->inc('stock',$find['nums'])->update(); + return $this->success('操作成功',[]); + } + return $this->fail('操作失败'); + } } \ No newline at end of file