|
@@ -31,18 +31,42 @@ class IndexModel |
|
@@ -31,18 +31,42 @@ class IndexModel |
31
|
//批量调接口获取数据
|
31
|
//批量调接口获取数据
|
32
|
$result = Yohobuy::getMulti($urlList, array(), true);
|
32
|
$result = Yohobuy::getMulti($urlList, array(), true);
|
33
|
|
33
|
|
|
|
34
|
+ // 组织模板数据
|
|
|
35
|
+ $data = HelperSearch::getList($result, $searchCondition['options']);
|
|
|
36
|
+
|
34
|
//调用接口获取list-index banner数据
|
37
|
//调用接口获取list-index banner数据
|
35
|
$msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false;
|
38
|
$msort = isset($searchCondition['condition']['msort']) ? $searchCondition['condition']['msort'] : false;
|
36
|
$misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
|
39
|
$misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
|
|
|
40
|
+ $positionId = isset($searchCondition['options']['positionId']) ? $searchCondition['options']['positionId'] : '';
|
37
|
$gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
|
41
|
$gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
|
38
|
if ($msort && $misort) {
|
42
|
if ($msort && $misort) {
|
39
|
- $bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array(10,$msort,$misort,$gender,0,0,0,0,0));
|
43
|
+ $bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array($positionId,$msort,$misort,$gender,0,0,0,0,0));
|
|
|
44
|
+ if (isset($bannerData['code']) && $bannerData['code'] == '200') {
|
|
|
45
|
+ $banner = self::formatBanner($bannerData['data']);
|
|
|
46
|
+ }
|
|
|
47
|
+ }
|
|
|
48
|
+ //插入banner数据
|
|
|
49
|
+ if (!empty($banner)) {
|
|
|
50
|
+ $data['sortIntro'] = $banner;
|
40
|
}
|
51
|
}
|
41
|
|
52
|
|
42
|
- // 组织模板数据
|
|
|
43
|
- $data = HelperSearch::getList($result, $searchCondition['options']);
|
|
|
44
|
-
|
|
|
45
|
return $data;
|
53
|
return $data;
|
46
|
}
|
54
|
}
|
47
|
|
55
|
|
|
|
56
|
+ //组织list-index banner数据
|
|
|
57
|
+ public static function formatBanner($bannerData)
|
|
|
58
|
+ {
|
|
|
59
|
+ $banner = array();
|
|
|
60
|
+ $banner['name'] = $bannerData['title'];
|
|
|
61
|
+ $banner['enName'] = $bannerData['subtitle'];
|
|
|
62
|
+ $banner['desc'] = $bannerData['intro'];
|
|
|
63
|
+ $banner['img'] = $bannerData['logo'];
|
|
|
64
|
+ foreach($bannerData['keyword'] as $key => $vo){
|
|
|
65
|
+ $banner['keyEntry'][$key]['name'] = $vo['word'];
|
|
|
66
|
+ $banner['keyEntry'][$key]['url'] = $vo['url'];
|
|
|
67
|
+ }
|
|
|
68
|
+
|
|
|
69
|
+ return $banner;
|
|
|
70
|
+ }
|
|
|
71
|
+
|
48
|
} |
72
|
} |