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