|
@@ -99,7 +99,7 @@ class Cart extends Controller
|
|
|
{
|
|
|
$userId = Session::get('user_id');
|
|
|
if (empty($userId)) {
|
|
|
- return $this->renderError( 'Log in');
|
|
|
+ return $this->renderJson( config('status.not_logged'),'Log in please!');
|
|
|
}
|
|
|
|
|
|
$model = new CartModel;
|
|
@@ -126,8 +126,13 @@ class Cart extends Controller
|
|
|
{
|
|
|
$userId = Session::get('user_id');
|
|
|
if (empty($userId)) {
|
|
|
- return $this->renderError( 'Log in');
|
|
|
+ return $this->renderJson( config('status.not_logged'),'Log in please!');
|
|
|
}
|
|
|
+
|
|
|
+ if ($goodsNum <= 0){
|
|
|
+ return $this->renderError('Action Not Supported!');
|
|
|
+ }
|
|
|
+
|
|
|
$model = new CartModel;
|
|
|
if (!$model->sUpdate($goodsId, $goodsSkuId, $goodsNum)) {
|
|
|
return $this->renderError($model->getError() ?: '更新失败');
|