ソースを参照

fix(product): 修复产品查询时未过滤阿里巴巴数据的问题

- 在查询spu_id时添加is_alibaba字段过滤条件,确保只获取非阿里巴巴的产品数据
- 防止阿里巴巴产品数据影响正常的库存和价格计算逻辑
shichen 3 ヶ月 前
コミット
e70939fb2a
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1 1
      app/common/repositories/store/product/ProductRepository.php

+ 1 - 1
app/common/repositories/store/product/ProductRepository.php

@@ -425,7 +425,7 @@ class ProductRepository extends BaseRepository
425 425
                     $value['detail'] = ['默认'];
426 426
                     $sku = '默认';
427 427
                 }
428
-                $product_data = Db::name('store_product')->where('product_id', $id)->value('spu_id');
428
+                $product_data = Db::name('store_product')->where('product_id', $id)->where('is_alibaba',0)->value('spu_id');
429 429
                 if ($product_data) {
430 430
                     if (!in_array($merId, ['319', '320', '321', '322', '323', '324', '325', '326', '327', '328'])) {
431 431
                         if ($value['price'] < $value['cost']) {