Authored by 周少峰

add page title

... ... @@ -221,6 +221,7 @@ class BrandData
* 通过域名获取品牌LOGO信息
*
* @param int $id 用户ID
* @modify sefon 2016-4-29 01:59:23
* @return array
*/
public static function getBrandLogoByDomain($domain)
... ... @@ -228,4 +229,19 @@ class BrandData
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/shops/service/v1/brand', 'getBrandByDomain', array($domain));
}
/**
* 根据品牌域名获取品牌店铺信息
* @param string $domain
* @author sefon 2016-4-28 23:35:28
* @return mixed
*/
public static function getShopInfoByBrandDomain($domain)
{
$param = Yohobuy::param();
$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);
}
}
... ...
... ... @@ -148,19 +148,4 @@ class ShopData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 取消收藏店铺
* @param string $domain
* @author sefon 2016-4-28 23:35:28
* @return mixed
*/
public static function getShopInfoByBrandDomain($domain)
{
$param = Yohobuy::param();
$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);
}
}
\ No newline at end of file
... ...
... ... @@ -46,7 +46,7 @@ class ShopProcess
//店铺简介页地址
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId));
//全部商品链接
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId), 'search');
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品'), 'search');
}
/**
... ...
... ... @@ -201,6 +201,7 @@ class ListModel
*
* @param int $id 品牌ID
* @param string $title 品牌标题
* @modify sefon 2016-4-29 01:57:14 添加shopId / type
* @return array | false
*/
public static function getBrandLogoByDomain($domain, &$title)
... ... @@ -218,6 +219,7 @@ class ListModel
// 调用接口查询数据
$brandLogo = BrandData::getBrandLogoByDomain($domain);
// $brandLogo = BrandData::getShopInfoByBrandDomain($domain); // TODO 获取品牌店铺信息
// 处理返回的数据
if (isset($brandLogo['data'])) {
$result = array(
... ... @@ -225,6 +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--->店铺页面
);
$title = $result['name'];
}
... ...
... ... @@ -139,7 +139,7 @@ class IndexController extends AbstractAction
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
$brandLogo['shopId'] = 672;
if (isset($brandLogo['shopId']) && !empty($brandLogo['shopId'])) {
$this->shopAction($brandLogo['shopId'], $uid);
$this->shop($brandLogo['shopId'], $uid);
exit;
}
$brandId = 0;
... ... @@ -453,10 +453,9 @@ class IndexController extends AbstractAction
/**
* 店铺首页
* @param int $shopId
* @param int $uid
* @author sefon 2016-4-26 20:50:58
*/
public function shopAction($shopId, $uid = 0)
private function shop($shopId)
{
$uid = $this->getUid(true);
$title = '';
... ...