瀏覽代碼

增加根据ID搜索条件

林琦海 5 年之前
父節點
當前提交
f24b01356d
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      app-ghs/controllers/ProductController.php

+ 7 - 0
app-ghs/controllers/ProductController.php

@@ -93,6 +93,13 @@ class ProductController extends BaseController
             $shopId = $this->shopId;
             $shopId = $this->shopId;
         }
         }
         $where['shopId'] = $shopId;
         $where['shopId'] = $shopId;
+        $productIds = Yii::$app->request->get('ids','');
+        if(!empty($productIds)){
+            $productIdArr = explode(',',$productIds);
+            if(!empty($productIdArr)){
+                $where['id'] = ['in', $productIdArr];
+            }
+        }
 
 
         $type = Yii::$app->request->get('type', '');
         $type = Yii::$app->request->get('type', '');
         $showPage = Yii::$app->request->get('showPage', 0);
         $showPage = Yii::$app->request->get('showPage', 0);