|
|
@@ -9,6 +9,7 @@
|
|
|
namespace business\controllers;
|
|
|
|
|
|
use biz\goods\services\CategoryService;
|
|
|
+use biz\goods\services\GoodsCategoryService;
|
|
|
use Yii;
|
|
|
use common\components\util;
|
|
|
|
|
|
@@ -74,5 +75,18 @@ class CategoryController extends BaseController
|
|
|
CategoryService::valid($category, $this->merchantId);
|
|
|
util::ok('删除成功');
|
|
|
}
|
|
|
+
|
|
|
+ //取分类下商品 shish 2019.12.2
|
|
|
+ public function actionGoodsList()
|
|
|
+ {
|
|
|
+ $categoryId = Yii::$app->request->get('categoryId');
|
|
|
+ //没有分类默认取商家第一个分类
|
|
|
+ $categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId();
|
|
|
+ $where = [];
|
|
|
+ $where['merchantId'] = $this->merchantId;
|
|
|
+ $where['cId'] = $categoryId;
|
|
|
+ $data = GoodsCategoryService::getGoodsList($where);
|
|
|
+ util::success($data);
|
|
|
+ }
|
|
|
|
|
|
}
|