...
|
...
|
@@ -13,7 +13,10 @@ class ShopProcess |
|
|
private static $shopData = array();
|
|
|
private static $shopId = 0;
|
|
|
private static $appVersion = 0;
|
|
|
//店铺品牌
|
|
|
private static $brandId;
|
|
|
//单品店
|
|
|
private static $single = false;
|
|
|
|
|
|
/**
|
|
|
* 组织店铺页面数据
|
...
|
...
|
@@ -25,7 +28,7 @@ class ShopProcess |
|
|
*/
|
|
|
public static function formShopData($data, $shopId, $appVersion)
|
|
|
{
|
|
|
self::$shopId = $shopId;
|
|
|
self::$shopData['shopId'] = self::$shopId = $shopId;
|
|
|
self::$shopData['appVersion'] = self::$appVersion = $appVersion;
|
|
|
foreach ($data as $key => $val) {
|
|
|
if (empty($val) || !is_callable("self::$key")) {
|
...
|
...
|
@@ -47,15 +50,23 @@ class ShopProcess |
|
|
self::$shopData['storeName'] = $data['data']['is_show_shop_name'] == 'Y' ? $data['data']['shop_name'] : '';
|
|
|
//用户是否收藏店铺
|
|
|
self::$shopData['collect'] = $data['data']['is_favorite'] == 'Y' ? true : false;
|
|
|
//店铺id
|
|
|
self::$shopData['shopId'] = self::$shopId;
|
|
|
|
|
|
//全部商品链接
|
|
|
$allGoodsParam['title'] = '全部商品';
|
|
|
//单品店
|
|
|
if (self::$single) {
|
|
|
$allGoodsParam['brand'] = self::$brandId;
|
|
|
} else {
|
|
|
//店铺id
|
|
|
self::$shopData['shopId'] = self::$shopId;
|
|
|
$allGoodsParam['shop_id'] = self::$shopId;
|
|
|
}
|
|
|
if (empty(self::$appVersion)) {
|
|
|
//全部商品链接
|
|
|
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品'), 'search');
|
|
|
self::$shopData['allGoods'] = Helpers::url('', $allGoodsParam, 'search');
|
|
|
//店铺简介页地址
|
|
|
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId));
|
|
|
} else {
|
|
|
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品'), 'search').'&openby:yohobuy={"action":"go.list","params":{"title":"全部商品", "actiontype":"0","shop_id":"'.self::$shopId.'","page":"1"}}';
|
|
|
self::$shopData['allGoods'] = Helpers::url('', $allGoodsParam, 'search').'&openby:yohobuy={"action":"go.list","params":{"title":"全部商品", "actiontype":"0","shop_id":"'.self::$shopId.'","page":"1"}}';
|
|
|
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId, 'app_version' => self::$appVersion));
|
|
|
}
|
|
|
//搜索链接
|
...
|
...
|
@@ -125,8 +136,9 @@ class ShopProcess |
|
|
$brandNumber = count($data);
|
|
|
//少于2个不展示 单品店:单品店根据品牌id查询
|
|
|
if ($brandNumber < 2) {
|
|
|
self::$shopData['brand'] = $data[0]['id'];
|
|
|
self::$shopData['shopId']= '';
|
|
|
self::$brandId = self::$shopData['brand'] = $data[0]['id'];
|
|
|
self::$single = true;
|
|
|
// self::$shopData['shopId']= '';
|
|
|
return;
|
|
|
}
|
|
|
foreach ($data as $val) {
|
...
|
...
|
|