...
|
...
|
@@ -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));
|
|
|
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -74,6 +74,10 @@ 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')) {
|
|
|
$url = strtr($url, array('http://' => '//'));
|
|
|
}
|
|
|
$filter = strstr($url, 'openby:yohobuy=', true);
|
|
|
if ($filter) {
|
|
|
return rtrim(rtrim($filter, '?'), '&');
|
...
|
...
|
@@ -247,9 +251,11 @@ 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'] . '_'
|
|
|
$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) {
|
...
|
...
|
@@ -354,6 +360,9 @@ 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://' => '//'));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 模板中需要的标签标识
|
...
|
...
|
@@ -811,10 +820,10 @@ class Helpers |
|
|
$url = 'https://login.m.yohobuy.com';
|
|
|
break;
|
|
|
case 'testing':
|
|
|
$url = 'http://m1.yohobuy.com';
|
|
|
$url = 'https://login.m.yohobuy.com'; //http://m1.yohobuy.com 没有https时
|
|
|
break;
|
|
|
default:
|
|
|
$url = 'http://m1.yohobuy.com';
|
|
|
$url = 'https://login.m.yohobuy.com';
|
|
|
break;
|
|
|
}
|
|
|
$url .= '/Passport/session/index?callback=' . $callback . '&sign=' . md5(md5($uid . 'Js8Yn0!EwPM45-ws')) . '&uid=' . $uid . '&go=' . $refer;
|
...
|
...
|
|