WIN-2308041133\Administrator 5 часов назад
Родитель
Сommit
8115e2dea4
1 измененных файлов с 12 добавлено и 3 удалено
  1. 12 3
      app/adminapi/controller/v1/product/StoreProduct.php

+ 12 - 3
app/adminapi/controller/v1/product/StoreProduct.php

@@ -128,10 +128,19 @@ class StoreProduct extends AuthController
             ['cate_id', ''],
             ['type', 1],
             ['sales', 'normal'],
-            ['is_gift',0],
-            ['is_repeat',0],
-            ['is_free',0]
+//            ['is_gift',0],
+//            ['is_repeat',0],
+//            ['is_free',0],
+            ['type',0]
         ]);
+        if ($where['type'] == 1){
+            $where['is_gift'] = 1;
+        }else if ($where['type'] == 2){
+            $where['is_repeat'] = 1;
+        }else if ($where['type'] == 3){
+            $where['is_free'] = 1;
+        }
+        unset($where['type']);
         $data = $this->service->getList($where);
         return app('json')->success($data);
     }