소스 검색

[智价云] 商品查询优化

tangyuanwang 13 시간 전
부모
커밋
6d605b4dd8
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 1
      app/Http/Controllers/Manager/WashConfig/LowPriceGoods.php
  2. 2 1
      app/Http/Controllers/Manager/WashConfig/ViolationProduct.php

+ 2 - 1
app/Http/Controllers/Manager/WashConfig/LowPriceGoods.php

@@ -68,7 +68,8 @@ class LowPriceGoods extends Controller
             $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('id', function ($query) use ($platform_ids) {
                 $query->select('product_id')
                     ->from('washconfig_lowprice_product_platform')
-                    ->whereIn('platform_id', $platform_ids);
+                    ->whereIn('platform_id', $platform_ids)
+                    ->distinct('product_id');
             });
         }
         $result = $LowPriceGoodsModel

+ 2 - 1
app/Http/Controllers/Manager/WashConfig/ViolationProduct.php

@@ -68,7 +68,8 @@ class ViolationProduct extends Controller
             $ViolationProductModel = $ViolationProductModel->whereIn('id', function ($query) use ($platform_ids) {
                 $query->select('product_id')
                     ->from('washconfig_violation_product_platform')
-                    ->whereIn('platform_id', $platform_ids);
+                    ->whereIn('platform_id', $platform_ids)
+                    ->distinct('product_id');;
             });
         }
         $result = $ViolationProductModel