From bbb6ca577e52608a047afcff60a1cbf8ab033803 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Thu, 15 May 2025 14:54:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E7=BC=BA=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CartController.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/api/controller/CartController.php b/app/api/controller/CartController.php index fdc2ebf..5758cdb 100644 --- a/app/api/controller/CartController.php +++ b/app/api/controller/CartController.php @@ -55,13 +55,13 @@ class CartController extends BaseApiController $post = $this->request->post(); $check = $this->validate($post, 'app\api\validate\Cart.change'); if ($check !== true) { - $this->_error($check); + $this->fail($check); } $res = CartLogic::change($post['cart_id'], $post['goods_num']); if ($res === true) { - $this->_success(); + $this->success(); } - $this->_error($res); + $this->fail($res); } @@ -70,12 +70,12 @@ class CartController extends BaseApiController $post = $this->request->post(); $check = $this->validate($post, 'app\api\validate\Cart.del'); if (true !== $check) { - $this->_error($check); + $this->fail($check); } - if (CartLogic::del($post['cart_id'], $this->user_id)) { - $this->_success('删除成功'); + if (CartLogic::del($post['cart_id'], $this->userId)) { + $this->success('删除成功'); } - $this->_error('删除失败'); + $this->fail('删除失败'); } @@ -84,15 +84,15 @@ class CartController extends BaseApiController $post = $this->request->post(); $check = $this->validate($post, 'app\api\validate\Cart.selected'); if (true !== $check) { - $this->_error($check); + $this->fail($check); } - CartLogic::selected($post, $this->user_id); - $this->_success(); + CartLogic::selected($post, $this->userId); + $this->success(); } public function num() { - $this->_success('',CartLogic::cartNum($this->user_id)); + $this->success('',CartLogic::cartNum($this->userId)); } } \ No newline at end of file