Authored by 周少峰

get shop info by brand domain, go shop or not

... ... @@ -30,8 +30,8 @@ class Yohobuy
// 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
// const API_URL = 'http://devapi.yoho.cn:58078/'; // 'http://192.168.102.205:8080/gateway/'
const API_URL = 'http://192.168.102.218:8080/gateway/';
const API_URL = 'http://devapi.yoho.cn:58078/'; // 'http://192.168.102.205:8080/gateway/'
// const API_URL = 'http://192.168.102.218:8080/gateway/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
... ... @@ -67,10 +67,10 @@ class Yohobuy
*/
public static function clientType()
{
if(self::isMobile()) {
return 'h5';
}
else {
return 'web';
... ... @@ -489,7 +489,7 @@ class Yohobuy
return $result;
}
/**
* 获取用户User-Agent
* @return bool
... ...
... ... @@ -241,7 +241,7 @@ class BrandData
$param['method'] = 'web.brand.byDomain';
$param['domain'] = $domain;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -218,8 +218,8 @@ class ListModel
}
// 调用接口查询数据
$brandLogo = BrandData::getBrandLogoByDomain($domain);
// $brandLogo = BrandData::getShopInfoByBrandDomain($domain); // TODO 获取品牌店铺信息
// $brandLogo = BrandData::getBrandLogoByDomain($domain);
$brandLogo = BrandData::getShopInfoByBrandDomain($domain); // TODO 获取品牌店铺信息
// 处理返回的数据
if (isset($brandLogo['data'])) {
$result = array(
... ... @@ -227,8 +227,8 @@ class ListModel
'url' => Helpers::url('', null, $brandLogo['data']['brand_domain']),
'thumb' => Helpers::getImageUrl($brandLogo['data']['brand_ico'], 75, 40),
'name' => $brandLogo['data']['brand_name'],
// 'shopId' => $brandLogo['data']['shop_id'],//店铺id
// 'type' => $brandLogo['data']['type'],//TODO 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
'shopId' => isset($brandLogo['data']['shop_id']) ? $brandLogo['data']['shop_id'] : 0,//店铺id
'type' => isset($brandLogo['data']['type']) ? $brandLogo['data']['type'] : 0,
);
$title = $result['name'];
}
... ...
... ... @@ -127,7 +127,7 @@ class IndexController extends AbstractAction
{
/* 品牌域名参数 @see Bootstrap.php */
$domain = $this->param('named');
$domain = 'vans';
$domain = 'andybrier';
if (empty($domain)) {
$this->go(SITE_MAIN);
}
... ... @@ -140,10 +140,11 @@ class IndexController extends AbstractAction
// if ($this->isApp() && !empty($appShopId)) {
// $this->shop($appShopId);
// }
//TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
//TODO 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
//TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
$brandLogo['shopId'] = 672;
if (isset($brandLogo['shopId']) && !empty($brandLogo['shopId'])) {
if ($brandLogo['type'] == 2 && !empty($brandLogo['shopId'])) {
$this->shop($brandLogo['shopId'], $uid);
exit;
}
... ...