WIN-2308041133\Administrator 5 kuukautta sitten
vanhempi
commit
d20cf568f7

+ 6 - 13
app/common/dao/store/product/SpuDao.php

@@ -83,19 +83,12 @@ class SpuDao extends  BaseDao
             ->when(isset($where['product_ids']) && $where['product_ids'] !== '',function($query)use($where){
                 $query->whereIn('P.product_id',$where['product_ids']);
             })
-//            ->when(isset($where['type']) && $where['type'] !== '',function($query)use($where){
-//                $query->whereIn('P.type',$where['type']);
-//            })
-            ->when(isset($where['type']), function($query) use($where) {
-//                if ($where['type'] === '') {
-//                    $query->whereIn('P.type', [0,1,2,3,4]);
-//                } else {
-                    $query->where('P.type', (int)$where['type']);
-//                }
-            })
-//            , function($query) {
-//                $query->whereIn('P.type', [0,1,2,3,4]);
-//            })
+            ->when(isset($where['is_oil']) && $where['is_oil'] !== '',function($query)use($where){
+                $query->whereIn('P.is_oil',$where['is_oil']);
+            })
+            ->when(isset($where['is_gift']) && $where['is_gift'] !== '',function($query)use($where){
+                $query->whereIn('P.is_gift',$where['is_gift']);
+            })
             ->when(isset($where['keyword']) && $where['keyword'] !== '',function($query)use($where){
                 if (is_numeric($where['keyword'])) {
                     $query->whereLike("S.store_name|S.keyword|S.product_id", "%{$where['keyword']}%");

+ 2 - 1
app/controller/api/store/product/StoreSpu.php

@@ -59,7 +59,8 @@ class StoreSpu extends BaseController
             'mer_id',
             'filter_params',
             'mer_type_id',
-            'type'
+            'is_oil',
+            'is_gift'
         ]);
         $where['is_gift_bag'] = 0;
 //        $where['product_type'] = 0;