| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace mall\controllers;
- use bizMall\ad\services\AdService;
- use bizMall\goods\services\CategoryService;
- use bizMall\goods\services\GoodsCategoryService;
- use Yii;
- use yii\web\Controller;
- use common\components\util;
- class MainController extends BaseController
- {
-
- //首页 shish 2019.12.2
- public function actionIndex()
- {
- $where = ['merchantId' => $this->sjId, 'type' => 0, 'status' => 1, 'delStatus' => 0];
- $adRespond = AdService::getAdList($where);
- $ad = [];
- if (isset($adRespond['list']) && !empty($adRespond['list'])) {
- foreach ($adRespond['list'] as $single) {
- $ad[] = ['adImg' => $single['adImgUrl'], 'url' => ''];
- }
- }
- $category = CategoryService::getTopThreeCategory($this->sjId);
- $categoryList = !empty($category) ? GoodsCategoryService::getAppointCategoryList($category) : [];
- $data = ['ad' => $ad, 'category' => $categoryList, 'columnStyle' => rand(1, 2)];
- util::success($data);
- }
-
- }
|