shish 6 лет назад
Родитель
Сommit
d0f86723b0
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      app/mall/controllers/MainController.php

+ 5 - 4
app/mall/controllers/MainController.php

@@ -11,14 +11,15 @@ use common\components\util;
 
 class MainController extends BaseController
 {
+
 	//首页 shish 2019.12.2
 	public function actionIndex()
 	{
 		$where = ['merchantId' => $this->merchantId, 'type' => 0, 'status' => 1];
-		$adList = AdService::getAdList($where);
+		$adRespond = AdService::getAdList($where);
 		$ad = [];
-		if (!empty($adList)) {
-			foreach ($adList as $single) {
+		if (isset($adRespond['list']) && !empty($adRespond['list'])) {
+			foreach ($adRespond['list'] as $single) {
 				$ad[] = ['adImg' => $single['adImgUrl'], 'url' => ''];
 			}
 		}
@@ -27,5 +28,5 @@ class MainController extends BaseController
 		$data = ['ad' => $ad, 'category' => $categoryList, 'columnStyle' => rand(1, 2)];
 		util::success($data);
 	}
-	
+
 }