| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace mall\controllers;
- use bizMall\goods\services\CategoryService;
- use bizMall\goods\services\GoodsCategoryService;
- use Yii;
- use yii\web\Controller;
- use common\components\util;
- class CategoryController extends BaseController
- {
-
- //获取分类 ssh 2019.12.2
- public function actionList()
- {
- $return = CategoryService::getEnableList($this->sjId);
- util::success($return);
- }
-
- //取分类下商品 ssh 2019.12.2
- public function actionGoodsList()
- {
- $categoryId = Yii::$app->request->get('categoryId');
- //没有分类默认取商家第一个分类
- $categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->sjId);
- $where = [];
- $where['merchantId'] = $this->sjId;
- $where['cId'] = $categoryId;
- $where['delStatus'] = 0;
- $data = GoodsCategoryService::getGoodsList($where);
- util::success($data);
- }
-
- }
|