|
@@ -92,7 +92,7 @@ class member_cartControl extends mbMemberControl
|
|
|
$goods_id = intval($_POST['goods_id']);
|
|
|
$quantity = intval($_POST['quantity']);
|
|
|
if ($goods_id <= 0 || $quantity <= 0) {
|
|
|
- return joutput_error(errcode::ErrCart, '参数错误');
|
|
|
+ return joutput_error(errcode::ErrInputParam);
|
|
|
}
|
|
|
|
|
|
$model_goods = Model('goods');
|
|
@@ -103,7 +103,7 @@ class member_cartControl extends mbMemberControl
|
|
|
|
|
|
//验证是否可以购买
|
|
|
if (empty($goods_info)) {
|
|
|
- return joutput_error(errcode::ErrCart, '商品已下架或不存在');
|
|
|
+ return joutput_error(errcode::ErrGoodsOff, '商品已下架或不存在');
|
|
|
}
|
|
|
|
|
|
//抢购
|
|
@@ -113,10 +113,10 @@ class member_cartControl extends mbMemberControl
|
|
|
$logic_buy_1->getXianshiInfo($goods_info, $quantity);
|
|
|
|
|
|
if ($goods_info['store_id'] == $this->member_info['store_id']) {
|
|
|
- return joutput_error(errcode::ErrCart, '不能购买自己发布的商品');
|
|
|
+ return joutput_error(errcode::ErrCanNotBuyOwn);
|
|
|
}
|
|
|
if (intval($goods_info['goods_storage']) < 1 || intval($goods_info['goods_storage']) < $quantity) {
|
|
|
- return joutput_error(errcode::ErrCart, '库存不足');
|
|
|
+ return joutput_error(errcode::ErrStorageShort);
|
|
|
}
|
|
|
|
|
|
$param = array();
|
|
@@ -132,7 +132,7 @@ class member_cartControl extends mbMemberControl
|
|
|
if ($result) {
|
|
|
joutput_data(array('result' => '1'));
|
|
|
} else {
|
|
|
- return joutput_error(errcode::ErrCart, '添加购物车失败!');
|
|
|
+ return joutput_error(errcode::ErrAddCart);
|
|
|
}
|
|
|
}
|
|
|
|