Authored by Rock Zhang

Merge branch 'hotfix/apichange-bug' into develop

Code Review By Rock Zhang
... ... @@ -119,7 +119,8 @@ $likeBtn.bind('click', function() {
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id
suggest_id: id,
reliable: 1
}
}).then(function(data) {
if (data.code === 200) {
... ... @@ -146,7 +147,8 @@ $disLikeBtn.bind('click', function() {
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id
suggest_id: id,
reliable: 2
}
}).then(function(data) {
if (data.code === 200) {
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<div id="hotRank"></div>
{{#if brand}}
... ...
... ... @@ -84,6 +84,18 @@ class BrandModel
$result['bannerTop']['list'][] = $build;
}
}
// 顶部的轮翻广告列表
elseif (!empty($brand['brandTop']['list'][0]['data'])) {
$build = array();
foreach ($brand['brandTop']['list'][0]['data'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['title'] = $value['title'];
$result['bannerTop']['list'][] = $build;
}
}
/* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
if (!empty($brand['brandTop'][1]['data']['list'])) {
... ...
... ... @@ -98,8 +98,8 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart(self::CODE_BG);
if (isset($banner['data'][0]['data']['list'][0]['src'])) {
$result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 2);
if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) {
$result = Helpers::getImageUrl($banner['data']['list'][0]['data']['list'][0]['src'], 640, 800, 2);
}
if (USE_CACHE) {
... ...
... ... @@ -302,7 +302,7 @@ class UserModel
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
}
... ...
... ... @@ -184,12 +184,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if(count($newsale['data']['list']) === 1) {
if (isset($newsale['code']) && isset($newsale['data']['list']) && !empty($newsale['data']['list'])) {
if(count($newsale['data']['list'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
foreach ($newsale['data']['list'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
}
}
}
... ...