Authored by 周少峰

Merge branch 'feature/seoUrl' into gray

... ... @@ -269,9 +269,7 @@ class Helpers
$result['salePrice'] && $result['salePrice'] .= '.00';
}
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = self::url('/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html', array(), 'item');
$result['url'] = self::getUrlBySkc($productData['product_id'], $productData['goods_list'][0]['goods_id'], $productData['cn_alphabet']);
// APP访问需要加附加的参数
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
if ($isApp) {
... ... @@ -790,7 +788,7 @@ class Helpers
// 商品链接
$cnAlphaBet = isset($value['cn_alphabet']) ? $value['cn_alphabet'] : md5($value['product_name']);
$oneGoods['link'] = self::url('/product/pro_' . $value['product_id'] . '_' . $value['goods_id'] . '/' . $cnAlphaBet . '.html', null, 'item');
$oneGoods['link'] = self::getUrlBySkc($value['product_id'], $value['goods_id'], $cnAlphaBet);
$result[] = $oneGoods;
}
... ... @@ -839,7 +837,7 @@ class Helpers
// 商品链接
if (isset($single['goods_id'])) {
$cnAlphaBet = isset($single['cn_alphabet']) ? $single['cn_alphabet'] : md5($single['product_name']);
$oneGoods['subjoinLink'] = self::url('/product/pro_' . $single['product_id'] . '_' . $single['goods_id'] . '/' . $cnAlphaBet . '.html', null, 'item');
$oneGoods['subjoinLink'] = self::getUrlBySkc($single['product_id'], $single['goods_id'], $cnAlphaBet);
} else {
$oneGoods['subjoinLink'] = self::url('/product/show_' . $single['product_id'] . '_' . $single['product_skn'] . '/' . Helpers::makeToken($single['product_skn']) . '.html', null, 'item');
}
... ... @@ -1004,10 +1002,7 @@ class Helpers
*/
public static function getUrlBySkc($product_id, $goods_id, $cn_alphabet='')
{
if (empty($cn_alphabet)) {
$cn_alphabet = 'goods.html';
}
return '//item.yohobuy.com/product/pro_' . $product_id . '_' . $goods_id . '/' . $cn_alphabet. '.html';
return '//item.yohobuy.com/p' . $product_id .'.html';
}
/**
... ... @@ -1064,14 +1059,7 @@ class Helpers
*/
public static function getProductUrl($productId, $productSkn, $productName = '', $cnAlphaBet = '')
{
$cnAlphaBet = empty($cnAlphaBet) ? $cnAlphaBet : md5($productName);
return self::url(
'/product/pro_' . $productId . '_' .
$productSkn . '/' . $cnAlphaBet . '.html',
null,
'item'
);
return self::getUrlBySkc($productId ,$productSkn, $cnAlphaBet);
}
/**
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -399,7 +399,7 @@ class CartModel
$build = array();
$build['id'] = $value['id'];
$build['skn'] = $value['product_skn'];
$build['href'] = Helpers::getUrlSafe($value['url']);
$build['href'] = Helpers::getUrlBySkc($value['id'], 0);
$build['title'] = $value['product_name'];
$build['img'] = Helpers::getImageUrl($value['default_pic'], 100, 100);
$build['alt'] = $value['product_name'];
... ... @@ -662,7 +662,7 @@ class CartModel
break;
}
$build['img'] .= '?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/90';
$build['href'] = Helpers::url('/product/pro_' . $value['product_id'] . '_' . $goodsId . '/' . $value['cn_alphabet'] . '.html', null, 'item');
$build['href'] = Helpers::getUrlBySkc($value['product_id'], $goodsId, $value['cn_alphabet']);
$result['data']['item'][] = $build;
... ...