|
|
@@ -5,28 +5,32 @@ 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
|
|
|
{
|
|
|
-
|
|
|
- //首页 ssh 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);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ //首页 ssh 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) : [];
|
|
|
+ $sj = $this->sj;
|
|
|
+ $data = [
|
|
|
+ 'ad' => $ad,
|
|
|
+ 'category' => $categoryList,
|
|
|
+ 'columnStyle' => rand(1, 2),
|
|
|
+ 'sj' => $sj
|
|
|
+ ];
|
|
|
+ util::success($data);
|
|
|
+ }
|
|
|
+
|
|
|
}
|