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