|
@@ -99,7 +99,7 @@ class StoreCart extends BaseController
|
|
99
|
if( $data['cart_num'] < 0 ) throw new ValidateException('数量必须大于0');
|
99
|
if( $data['cart_num'] < 0 ) throw new ValidateException('数量必须大于0');
|
|
100
|
$product = $product_make->getWhere(['product_id' => $data['product_id']],'*');
|
100
|
$product = $product_make->getWhere(['product_id' => $data['product_id']],'*');
|
|
101
|
if(!$product) throw new ValidateException('商品不存在');
|
101
|
if(!$product) throw new ValidateException('商品不存在');
|
|
102
|
- // if (!$product['is_show'] == 0) throw new ValidateException('商品已下架');
|
|
|
|
|
|
102
|
+ if ($product['is_show'] == 0) throw new ValidateException('商品已下架');
|
|
103
|
$res = $value_make->getOptionByUnique($data['product_attr_unique']);
|
103
|
$res = $value_make->getOptionByUnique($data['product_attr_unique']);
|
|
104
|
if(!$res) throw new ValidateException('SKU不存在');
|
104
|
if(!$res) throw new ValidateException('SKU不存在');
|
|
105
|
if($res['product_id'] != $data['product_id']) throw new ValidateException('数据不一致');
|
105
|
if($res['product_id'] != $data['product_id']) throw new ValidateException('数据不一致');
|