...
|
...
|
@@ -24,16 +24,16 @@ class Helpers |
|
|
|
|
|
switch ($module) {
|
|
|
case 'default':
|
|
|
$url = '//m.yohobuy.com';
|
|
|
$url = 'http://m.yohobuy.com';
|
|
|
break;
|
|
|
case 'guang': // 逛
|
|
|
$url = '//guang' . SUB_DOMAIN;
|
|
|
$url = 'http://guang' . SUB_DOMAIN;
|
|
|
break;
|
|
|
case 'list': // 商品列表
|
|
|
$url = '//list' . SUB_DOMAIN;
|
|
|
$url = 'http://list' . SUB_DOMAIN;
|
|
|
break;
|
|
|
case 'search': // 搜索
|
|
|
$url = '//search' . SUB_DOMAIN;
|
|
|
$url = 'http://search' . SUB_DOMAIN;
|
|
|
break;
|
|
|
case 'index': // 默认
|
|
|
$url = SITE_MAIN;
|
...
|
...
|
@@ -41,7 +41,7 @@ class Helpers |
|
|
case '': // 相对地址
|
|
|
break;
|
|
|
default: // 其它子域名
|
|
|
$url = '//' . $module . SUB_DOMAIN;
|
|
|
$url = 'http://' . $module . SUB_DOMAIN;
|
|
|
}
|
|
|
$url .= $uri;
|
|
|
if (!empty($param)) {
|
...
|
...
|
@@ -62,7 +62,7 @@ class Helpers |
|
|
*/
|
|
|
public static function getImageUrl($url, $width, $height, $mode = 2)
|
|
|
{
|
|
|
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
|
|
|
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode));
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -87,10 +87,6 @@ class Helpers |
|
|
public static function getFilterUrl($url)
|
|
|
{
|
|
|
$url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN));
|
|
|
if (strrpos($url, 'm.yohobuy.com') && !strrpos($url, 'sale.m.yohobuy.com') && !strrpos($url, 'cuxiao.m.yohobuy.com')
|
|
|
&& !strrpos($url, 'activity.m.yohobuy.com') && !strrpos($url, 'huodong.m.yohobuy.com') && strrpos($url, 'cdn.yoho.cn/myohobuy') && !strrpos($url, '/home/orders/pay')) {
|
|
|
$url = strtr($url, array('http://' => '//'));
|
|
|
}
|
|
|
$filter = strstr($url, 'openby:yohobuy=', true);
|
|
|
if ($filter) {
|
|
|
return rtrim(rtrim($filter, '?'), '&');
|
...
|
...
|
@@ -264,11 +260,9 @@ class Helpers |
|
|
$result['salePrice'] && $result['salePrice'] .= '.00';
|
|
|
}
|
|
|
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
|
|
|
$url = self::url('/product/pro_' . $productData['product_id'] . '_'
|
|
|
$result['url'] = self::url('/product/pro_' . $productData['product_id'] . '_'
|
|
|
. $productData['goods_list'][0]['goods_id']
|
|
|
. '/' . $productData['cn_alphabet'] . '.html');
|
|
|
$result['url'] = strtr($url, array('http://' => '//'));
|
|
|
|
|
|
// APP访问需要加附加的参数
|
|
|
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
|
|
|
if ($isApp) {
|
...
|
...
|
@@ -373,9 +367,6 @@ class Helpers |
|
|
$articleData['author']['url'] = Helpers::getFilterUrl($articleData['author']['url']);
|
|
|
}
|
|
|
$result['author'] = $articleData['author'];
|
|
|
if (isset($result['author']['avatar'])) {
|
|
|
$result['author']['avatar'] = strtr($result['author']['avatar'], array('http://' => '//'));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 模板中需要的标签标识
|
...
|
...
|
|