From 9fb3dcfba14136a48944506704c297daf795ea8f Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Fri, 23 Aug 2024 14:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/LocalStoreGoods.php | 3 +-- app/api/logic/LocalStoreGoodsLogic.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/api/controller/LocalStoreGoods.php b/app/api/controller/LocalStoreGoods.php index 9dc60b0c..4fcf2eca 100755 --- a/app/api/controller/LocalStoreGoods.php +++ b/app/api/controller/LocalStoreGoods.php @@ -66,8 +66,7 @@ class LocalStoreGoods extends Api public function setState() { $form = $this->request->post(); - dump($form);die; -// $result = LocalStoreGoodsLogic::setState($form); + $result = LocalStoreGoodsLogic::setState($form, $this->user_id); } } \ No newline at end of file diff --git a/app/api/logic/LocalStoreGoodsLogic.php b/app/api/logic/LocalStoreGoodsLogic.php index 6f7713c6..b16fdc06 100644 --- a/app/api/logic/LocalStoreGoodsLogic.php +++ b/app/api/logic/LocalStoreGoodsLogic.php @@ -152,8 +152,17 @@ class LocalStoreGoodsLogic extends Logic } // 设置状态 - public static function setState($form) + public static function setState($form, $user_id) { + if (isset(self::$STATUS[$form['type']])) { + $state = self::$STATUS[$form['type']]; + dump($state);die; + $result = LocalStoreGoods::where(['id' => $form['id'], 'user_id' => $user_id, 'lstore_id' => $form['lstore_id']])->update([ + 'state' => $state, + ]); + return $result; + } + return false; } } \ No newline at end of file