shish 6 лет назад
Родитель
Сommit
adb85b5b7a
1 измененных файлов с 13 добавлено и 3 удалено
  1. 13 3
      app/business/controllers/GoodsController.php

+ 13 - 3
app/business/controllers/GoodsController.php

@@ -16,11 +16,21 @@ use biz\goods\services\GoodsService;
 
 class GoodsController extends BaseController
 {
-	
+
 	//商品列表 shish 2019.12.7
 	public function actionList()
 	{
-		$where = ['merchantId' => $this->merchantId];
+		$get = Yii::$app->request->get();
+		$status = isset($get['status']) ? $get['status'] : -1;
+		$goodsName = isset($get['goodsName']) && !empty($get['goodsName']) ? $get['goodsName'] : '';
+		$where = [];
+		if ($status != -1) {
+			$where['status'] = $status;
+		}
+		if (!empty($goodsName)) {
+			$where['goodsName'] = ['like', $goodsName];
+		}
+		$where['merchantId'] = $this->merchantId;
 		$data = GoodsService::getGoodsList($where);
 		$asset = $this->merchantAsset;
 		$data['MerchantAsset'] = $asset;
@@ -57,7 +67,7 @@ class GoodsController extends BaseController
 		GoodsService::updateGoods($id, $data);
 		util::ok();
 	}
-
+	
 	//商品排序
 	public function actionSort()
 	{