shish 6 سال پیش
والد
کامیت
93d88ae6da
1فایلهای تغییر یافته به همراه7 افزوده شده و 7 حذف شده
  1. 7 7
      app/mall/controllers/MainController.php

+ 7 - 7
app/mall/controllers/MainController.php

@@ -14,14 +14,14 @@ class MainController extends BaseController
 	//首页 shish 2019.12.2
 	public function actionIndex()
 	{
-		$ad = [
-			['adImg' => 'http://img.fjglhs.com/images/glhs/glhs_banner1.jpg', 'url' => ''],
-			['adImg' => 'http://img.fjglhs.com/images/glhs/glhs_banner2.jpg', 'url' => ''],
-			['adImg' => 'http://img.fjglhs.com/images/glhs/glhs_banner3.jpg', 'url' => ''],
-		];
 		$where = ['merchantId' => $this->merchantId, 'type' => 0, 'status' => 1];
-		$ad = AdService::getAdList($where);
-		dd($ad);
+		$adList = AdService::getAdList($where);
+		$ad = [];
+		if (!empty($adList)) {
+			foreach ($adList as $single) {
+				$ad[] = ['adImg' => $single['adImgUrl'], 'url' => ''];
+			}
+		}
 		$category = CategoryService::getTopThreeCategory($this->merchantId);
 		$categoryList = !empty($category) ? GoodsCategoryService::getAppointCategoryList($category) : [];
 		$data = ['ad' => $ad, 'category' => $categoryList, 'columnStyle' => rand(1, 2)];