Authored by 梁志锋

Merge remote-tracking branch 'origin/develop/wap' into develop/wap

... ... @@ -75,7 +75,7 @@ class Cache
// 当接口异常,一级缓存没取到数据的情况
if ($node === 'slave') {
$incrementKey = self::makeKey('_increment_' . $key, 'slave');
$incrementValue = HoodCache::Memcached('slave')->get($incrementKey, 'slave');
$incrementValue = HoodCache::Memcached('slave')->get($incrementKey);
// 接口调用失败累计5次之后,回填二级缓存数据到一级缓存, 重置计数值为0
if (is_int($incrementValue) && $incrementValue > 5) {
HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $result, 300);
... ...
... ... @@ -18,7 +18,7 @@ server
#cc: e0323a9039add2978bf5b49550572c7c oo:e47ca7a09cf6781e29634502345930a7
#acecl:7ea6bdf07376a928c5d4677789c45463 opqcl:352f028bd6ecf28de1c285c573642659
default_type application/json;
return 200 '{"code":200,"message":"Config Success","md5":"1231231231231","data":{"ae":"e0323a9039add2978bf5b49550572c7c","url":"http://m.yohobuy.com","tl":"352f028bd6ecf28de1c285c573642659"}}';
return 200 '{"code":200,"message":"Config Success","md5":"e0323a9039add2978bf5b49550572cff","data":{"ae":"e0323a9039add2978bf5b49550572c7c","url":"http://m.yohobuy.com","tl":"352f028bd6ecf28de1c285c573642659"}}';
}
# hotfix
location = /hf/v1 {
... ...
... ... @@ -95,7 +95,7 @@ function loadData($parent, url, page) {
//处理data等于end时如果loadingMask存在且没有hide样式的情况
if ($loadingMask && !$loadingMask.hasClass('hide')) {
$loadingMask.addClass('hide');
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
}
$parent.closest('.fav-type').find('.fav-load-background')
... ...
... ... @@ -113,6 +113,11 @@ class SearchController extends AbstractAction
$classNames = Category\ClassModel::getClassNames();
do {
// 品类名称为空时跳出
if (empty($classNames)) {
break;
}
/* 精确查一级品类 */
$sorts = array_keys($classNames['first'], $query, true);
if (isset($sorts[0])) {
... ...
... ... @@ -188,7 +188,19 @@ class UserModel
$favProduct = UserData::favoriteProductData($uid, $page, $limit);
// 处理用户收藏的商品数据
if (isset($favProduct['data']) && $page <= $favProduct['data']['page_total']) {
do {
// 开始就没获取到数据或者获取的数据为空时的处理
if ((!$favProduct || isset($favProduct['data']['product_list']) && empty($favProduct['data']['product_list'])) && $page == 1) {
break;
}
// 加载第二页以及第二页之后的数据时接口不返回时的处理
if ($page > 1 && !$favProduct) {
$result['end'] = true;
break;
}
if ($page <= $favProduct['data']['page_total']) {
$datas = array();
$product = array();
foreach ($favProduct['data']['product_list'] as $val) {
... ... @@ -209,11 +221,16 @@ class UserModel
$datas[] = $product;
}
!empty($datas) && $result['hasFavProduct'] = $datas;
} else if (($page > 1 && !$favProduct) || $page > $favProduct['data']['page_total']) {
if (!empty($datas)) {
$result['hasFavProduct'] = $datas;
}
} else {
$result['end'] = true;
}
} while (false);
return $result;
}
... ... @@ -234,7 +251,19 @@ class UserModel
$favBrand = UserData::favoriteBrandData($uid, $gender, $page, $limit);
// 处理用户收藏的品牌数据
if (isset($favBrand['data']) && $page <= $favBrand['data']['page_total']) {
do {
// 开始就没获取到数据或者获取的数据为空时的处理
if ((!$favBrand || isset($favBrand['data']['total']) && empty($favBrand['data']['total'])) && $page == 1) {
break;
}
// 加载第二页以及第二页之后的数据时接口不返回时的处理
if ($page > 1 && !$favBrand) {
$result['end'] = true;
break;
}
if ($page <= $favBrand['data']['page_total']) {
$datas = array();
$brand = array();
foreach ($favBrand['data']['brand_list'] as $val) {
... ... @@ -264,10 +293,14 @@ class UserModel
$datas[] = $brand;
}
!empty($datas) && $result['hasFavBrand'] = $datas;
} else if (($page > 1 && !$favBrand) || $page > $favBrand['data']['page_total']) {
if (!empty($datas)) {
$result['hasFavBrand'] = $datas;
}
} else {
$result['end'] = true;
}
} while (false);
return $result;
}
... ... @@ -331,7 +364,7 @@ class UserModel
$record = array();
$record['product_name'] = $val['product_name'];
$record['product_id'] = $val['product_id'];
$record['product_skn'] = $val['product_skn'];
$record['link'] = Helpers::url('/product/show_' . $val['product_skn'] . '.html');
$record['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$record['sales_price'] = Helpers::transPrice($val['sales_price']);
... ...
... ... @@ -148,7 +148,7 @@ class InfoController extends AbstractAction
}
// 更多商品链接
elseif (isset($value['link'])) {
$build['link'] = $value['link']['data'][0]['url'];
$build['moreLink'] = $value['link']['data'][0]['url'];
}
$data['detail']['content'][] = $build;
... ... @@ -319,7 +319,7 @@ class InfoController extends AbstractAction
}
// 更多商品链接
elseif (isset($value['link'])) {
$build['link'] = $value['link']['data'][0]['url'];
$build['moreLink'] = $value['link']['data'][0]['url'];
}
$data['detail']['content'][] = $build;
... ... @@ -455,7 +455,7 @@ class InfoController extends AbstractAction
}
// 更多商品链接
elseif (isset($value['link'])) {
$build['link'] = $value['link']['data'][0]['url'];
$build['moreLink'] = $value['link']['data'][0]['url'];
}
// 内容详情
... ...