Authored by 周少峰

get shop info by brand domain, go shop or not

@@ -30,8 +30,8 @@ class Yohobuy @@ -30,8 +30,8 @@ class Yohobuy
30 30
31 // 测试环境 */ 31 // 测试环境 */
32 // const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/' 32 // const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
33 -// const API_URL = 'http://devapi.yoho.cn:58078/'; // 'http://192.168.102.205:8080/gateway/'  
34 - const API_URL = 'http://192.168.102.218:8080/gateway/'; 33 + const API_URL = 'http://devapi.yoho.cn:58078/'; // 'http://192.168.102.205:8080/gateway/'
  34 +// const API_URL = 'http://192.168.102.218:8080/gateway/';
35 const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; 35 const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
36 const YOHOBUY_URL = 'http://www.yohobuy.com/'; 36 const YOHOBUY_URL = 'http://www.yohobuy.com/';
37 37
@@ -67,10 +67,10 @@ class Yohobuy @@ -67,10 +67,10 @@ class Yohobuy
67 */ 67 */
68 public static function clientType() 68 public static function clientType()
69 { 69 {
70 - 70 +
71 if(self::isMobile()) { 71 if(self::isMobile()) {
72 return 'h5'; 72 return 'h5';
73 - 73 +
74 } 74 }
75 else { 75 else {
76 return 'web'; 76 return 'web';
@@ -489,7 +489,7 @@ class Yohobuy @@ -489,7 +489,7 @@ class Yohobuy
489 489
490 return $result; 490 return $result;
491 } 491 }
492 - 492 +
493 /** 493 /**
494 * 获取用户User-Agent 494 * 获取用户User-Agent
495 * @return bool 495 * @return bool
@@ -241,7 +241,7 @@ class BrandData @@ -241,7 +241,7 @@ class BrandData
241 $param['method'] = 'web.brand.byDomain'; 241 $param['method'] = 'web.brand.byDomain';
242 $param['domain'] = $domain; 242 $param['domain'] = $domain;
243 $param['client_secret'] = Sign::getSign($param); 243 $param['client_secret'] = Sign::getSign($param);
244 - return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param); 244 + return Yohobuy::get(Yohobuy::API_URL, $param);
245 } 245 }
246 246
247 } 247 }
@@ -218,8 +218,8 @@ class ListModel @@ -218,8 +218,8 @@ class ListModel
218 } 218 }
219 219
220 // 调用接口查询数据 220 // 调用接口查询数据
221 - $brandLogo = BrandData::getBrandLogoByDomain($domain);  
222 -// $brandLogo = BrandData::getShopInfoByBrandDomain($domain); // TODO 获取品牌店铺信息 221 +// $brandLogo = BrandData::getBrandLogoByDomain($domain);
  222 + $brandLogo = BrandData::getShopInfoByBrandDomain($domain); // TODO 获取品牌店铺信息
223 // 处理返回的数据 223 // 处理返回的数据
224 if (isset($brandLogo['data'])) { 224 if (isset($brandLogo['data'])) {
225 $result = array( 225 $result = array(
@@ -227,8 +227,8 @@ class ListModel @@ -227,8 +227,8 @@ class ListModel
227 'url' => Helpers::url('', null, $brandLogo['data']['brand_domain']), 227 'url' => Helpers::url('', null, $brandLogo['data']['brand_domain']),
228 'thumb' => Helpers::getImageUrl($brandLogo['data']['brand_ico'], 75, 40), 228 'thumb' => Helpers::getImageUrl($brandLogo['data']['brand_ico'], 75, 40),
229 'name' => $brandLogo['data']['brand_name'], 229 'name' => $brandLogo['data']['brand_name'],
230 -// 'shopId' => $brandLogo['data']['shop_id'],//店铺id  
231 -// 'type' => $brandLogo['data']['type'],//TODO 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面 230 + 'shopId' => isset($brandLogo['data']['shop_id']) ? $brandLogo['data']['shop_id'] : 0,//店铺id
  231 + 'type' => isset($brandLogo['data']['type']) ? $brandLogo['data']['type'] : 0,
232 ); 232 );
233 $title = $result['name']; 233 $title = $result['name'];
234 } 234 }
@@ -127,7 +127,7 @@ class IndexController extends AbstractAction @@ -127,7 +127,7 @@ class IndexController extends AbstractAction
127 { 127 {
128 /* 品牌域名参数 @see Bootstrap.php */ 128 /* 品牌域名参数 @see Bootstrap.php */
129 $domain = $this->param('named'); 129 $domain = $this->param('named');
130 - $domain = 'vans'; 130 + $domain = 'andybrier';
131 if (empty($domain)) { 131 if (empty($domain)) {
132 $this->go(SITE_MAIN); 132 $this->go(SITE_MAIN);
133 } 133 }
@@ -140,10 +140,11 @@ class IndexController extends AbstractAction @@ -140,10 +140,11 @@ class IndexController extends AbstractAction
140 // if ($this->isApp() && !empty($appShopId)) { 140 // if ($this->isApp() && !empty($appShopId)) {
141 // $this->shop($appShopId); 141 // $this->shop($appShopId);
142 // } 142 // }
143 - //TODO 通过品牌域名获取店铺shopId 先固定shopId = 672  
144 $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title); 143 $brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
  144 + //TODO 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
  145 + //TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
145 $brandLogo['shopId'] = 672; 146 $brandLogo['shopId'] = 672;
146 - if (isset($brandLogo['shopId']) && !empty($brandLogo['shopId'])) { 147 + if ($brandLogo['type'] == 2 && !empty($brandLogo['shopId'])) {
147 $this->shop($brandLogo['shopId'], $uid); 148 $this->shop($brandLogo['shopId'], $uid);
148 exit; 149 exit;
149 } 150 }