...
|
...
|
@@ -142,9 +142,6 @@ class IndexController extends AbstractAction |
|
|
$title = '';
|
|
|
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
|
|
|
|
|
|
//如果店铺使用基础模板TODO
|
|
|
$baseBanner = ListModel::getShopBaseBanner($brandLogo['shopId']);
|
|
|
|
|
|
//无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
|
|
|
if ($brandLogo['type'] == 2 && !empty($brandLogo['shopId'])) {
|
|
|
$this->shop($brandLogo['shopId'], $uid);
|
...
|
...
|
@@ -249,10 +246,7 @@ class IndexController extends AbstractAction |
|
|
}
|
|
|
$this->setTitle($title);
|
|
|
$this->setNavHeader($title, true, SITE_MAIN);
|
|
|
//店铺页banner
|
|
|
if ($baseBanner) {
|
|
|
$data['brandHome']['banner'] = $data['brandHome'];
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -461,9 +455,10 @@ class IndexController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺首页
|
|
|
* 店铺首页 || 若店铺使用基础模板跳转品牌页
|
|
|
* @param int $shopId
|
|
|
* @author sefon 2016-4-26 20:50:58
|
|
|
* @return int
|
|
|
*/
|
|
|
private function shop($shopId)
|
|
|
{
|
...
|
...
|
@@ -479,6 +474,11 @@ class IndexController extends AbstractAction |
|
|
$this->setCookie('appUid', $uid);
|
|
|
}
|
|
|
$data = ListModel::shopData($shopId, $uid, $appVersion);
|
|
|
if (isset($data['goBrand'])) {
|
|
|
//跳转基础模板
|
|
|
self::baseShop($data['goBrand']);
|
|
|
exit;
|
|
|
}
|
|
|
$this->_view->display('shop', array(
|
|
|
'shopIndex' => $data,
|
|
|
'shopPage' => array(
|
...
|
...
|
@@ -490,6 +490,97 @@ class IndexController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺基础模板
|
|
|
* @param int $shop
|
|
|
* @author sefon 2016-4-26 20:50:58
|
|
|
* @return int
|
|
|
*/
|
|
|
private function baseShop($shop)
|
|
|
{
|
|
|
/* 过滤请求参数 */
|
|
|
$condition = filter_input_array(INPUT_GET, array(
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'brand' => FILTER_DEFAULT,
|
|
|
'msort' => FILTER_DEFAULT,
|
|
|
'misort' => FILTER_DEFAULT,
|
|
|
'color' => FILTER_DEFAULT,
|
|
|
'size' => FILTER_DEFAULT,
|
|
|
'style' => FILTER_DEFAULT,
|
|
|
'price' => FILTER_DEFAULT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
|
|
|
|
|
|
|
|
if ($shop['mult_brand_shop_type'] == 2) {
|
|
|
// 转义店铺
|
|
|
$condition['shop_id'] = $shop['shops_id'];
|
|
|
} else {
|
|
|
$brands = ShopData::getShopBrands($shop['shops_id']);
|
|
|
if (isset($brands['code']) && $brands['code'] == 200 && isset($brands['data']) && !empty($brands['data']))
|
|
|
$condition['brand'] = $brands['data'][0]['brand_id'];
|
|
|
}
|
|
|
|
|
|
// 转义分类
|
|
|
if (isset($condition['sort'])) {
|
|
|
$condition['sort'] = rawurldecode($condition['sort']);
|
|
|
}
|
|
|
// 转义一级分类
|
|
|
if (isset($condition['msort'])) {
|
|
|
$condition['msort'] = rawurldecode($condition['msort']);
|
|
|
}
|
|
|
// 转义二级分类
|
|
|
if (isset($condition['misort'])) {
|
|
|
$condition['misort'] = rawurldecode($condition['misort']);
|
|
|
}
|
|
|
// 转义颜色
|
|
|
if (isset($condition['color'])) {
|
|
|
$condition['color'] = rawurldecode($condition['color']);
|
|
|
}
|
|
|
// 转义尺码
|
|
|
if (isset($condition['size'])) {
|
|
|
$condition['size'] = rawurldecode($condition['size']);
|
|
|
}
|
|
|
// 转义风格
|
|
|
if (isset($condition['style'])) {
|
|
|
$condition['style'] = rawurldecode($condition['style']);
|
|
|
}
|
|
|
// 转义价格
|
|
|
if (isset($condition['price'])) {
|
|
|
$condition['price'] = rawurldecode($condition['price']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
}
|
|
|
// 为了兼容现在运营在用的p_d
|
|
|
if (isset($condition['p_d'])) {
|
|
|
$condition['discount'] = rawurldecode($condition['p_d']);
|
|
|
}
|
|
|
|
|
|
if (isset($condition['gender'])) {
|
|
|
$condition['gender'] = rawurldecode($condition['gender']);
|
|
|
}/* else {
|
|
|
$condition['gender'] = Helpers::getGenderByCookie();
|
|
|
}*/
|
|
|
|
|
|
$data = array();
|
|
|
$data['goodListPage'] = true;
|
|
|
$data['showDownloadApp'] = true;
|
|
|
$title = $shop['shop_name'];
|
|
|
// 右下角的购物车链接
|
|
|
$data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null);
|
|
|
$data['goodList'] += $condition;
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
$this->setTitle($title);
|
|
|
$this->setNavHeader($title, true, SITE_MAIN);
|
|
|
//店铺页banner
|
|
|
$data['shopBanner']['banner'] = ListModel::getShopBaseBanner($shop['shops_id']);
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺收藏
|
|
|
* @author sefon 2016-4-28 23:00:11
|
|
|
*/
|
...
|
...
|
@@ -516,7 +607,6 @@ class IndexController extends AbstractAction |
|
|
$toUrl .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"'.$refer.'","param":{}},"requesturl":{"param":{},"url":""},"priority":"Y"}}';
|
|
|
}
|
|
|
$data['url'] = $toUrl;
|
|
|
// print_r($data); exit;
|
|
|
break;
|
|
|
}
|
|
|
if (!empty($shopId) && !empty($uid)) {
|
...
|
...
|
|