Authored by hf

code review by fei.hong : fixes bug to modify Helpers.php undifined vars and modify searchd ip

... ... @@ -29,12 +29,13 @@ class SearchData
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
switch (APPLICATION_ENV) {
case 'release':
return 'http://100.98.132.63/yohosearch/search.json';
case 'test':
return 'http://101.201.178.220/yohosearch/search.json';//return 'http://100.98.132.63/yohosearch/search.json';
case 'preview':
return 'http://101.200.31.165/yohosearch/search.json';
case 'test':
case 'developer':
default:
return 'http://101.200.31.165/yohosearch/search.json';//return 'http://192.168.10.64:8080/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search.json';
}
}
... ...
... ... @@ -218,14 +218,10 @@ class Helpers
$productData['market_price'] = false;
}
$flag = false; // 判别默认的商品是否将默认的图片URL赋值到skn
$firstGood = array(); // 第一个skc产品
// 判别默认的商品是否将默认的图片URL赋值到skn
$flag = false;
// 如果设置了默认图片,就取默认的图片
foreach ($productData['goods_list'] as $oneGoods) {
if (empty($firstGood)) {
$firstGood = $oneGoods;
}
// 此skc是默认的,则将图片赋值给skn
if ($oneGoods['is_default'] === 'Y') {
$productData['default_images'] = self::procProductImg($oneGoods);
... ... @@ -233,8 +229,8 @@ class Helpers
}
}
// 如果还未赋值,则取第一个skc产品的默认图片
if (!$flag && !empty($firstGood)) {
$productDatap['default_images'] = self::procProductImg($firstGood);
if (!$flag) {
$productData['default_images'] = self::procProductImg($productData['goods_list'][0]);
}
$result = array();
... ... @@ -286,12 +282,15 @@ class Helpers
}
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3 则优先从cover2 --》 cover1 -- 》 images_url
* 否则优先从cover1 --》 cover2 -- 》 images_url
* 根据性别来决定 默认图片获取字段 如果是 2、3
*
* 则优先从cover2 --》 cover1 -- 》 images_url
* 否则优先从cover1 --》 cover2 -- 》 images_url
*
* @param array $images
* @return string 商品图片
*/
private static function procProductImg($images)
public static function procProductImg($images)
{
$imgUrl = isset($images['images_url']) ? $images['images_url'] : '';
$cover1 = isset($images['cover_1']) ? $images['cover_1'] : '';
... ... @@ -800,7 +799,7 @@ class Helpers
*/
public static function syncUserSession($uid, $refer = '', $callback = 'call')
{
return 'http://m1.yohobuy.com/Passport/session/index?callback=' . $callback
return 'http://mapi.yohobuy.com/Passport/session/index?callback=' . $callback
. '&sign=' . md5(md5($uid . 'Js8Yn0!EwPM45-ws')) . '&uid=' . $uid . '&go=' . $refer;
}
... ... @@ -816,7 +815,7 @@ class Helpers
*/
public static function logoutSession($token, $refer = '', $callback = 'call')
{
return 'http://m1.yohobuy.com/Passport/session/logout?callback=' . $callback
return 'http://mapi.yohobuy.com/Passport/session/logout?callback=' . $callback
. '&sign=' . md5(md5('Js8Yn0!EwPM45-ws')) . '&token=' . $token . '&go=' . $refer;
}
... ... @@ -858,7 +857,7 @@ class Helpers
*/
public static function makeMobile($area, $mobile){
if(empty($area) || $area == 86){
return $mobile;
return $mobile;
}
return $area.'-'.$mobile;
}
... ...