Преглед изворни кода

fix(store): 修复商品下架验证逻辑

- 注释掉商品下架状态检查代码,解决商品无法正常加入购物车的问题
- 保留原有的商品存在性验证和其他业务逻辑
- 避免因商品显示状态判断错误导致的购物车添加失败
shichen пре 2 месеци
родитељ
комит
d09dbfa461
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      app/controller/api/store/order/StoreCart.php

+ 1 - 1
app/controller/api/store/order/StoreCart.php

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