|
|
@@ -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);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|