...
|
...
|
@@ -29,6 +29,9 @@ class ShopModel |
|
|
if (is_callable("self::$fun")) {
|
|
|
$list = self::$fun(self::getResourceData($list), $parameters);
|
|
|
switch ($fun) {
|
|
|
case 'signboard':
|
|
|
//过滤不合法的数据
|
|
|
break;
|
|
|
case 'newProducts':
|
|
|
$data['newArrivel']['name'] = '新品上架 NEW';
|
|
|
$data['newArrivel']['list'] = $list;
|
...
|
...
|
@@ -80,7 +83,8 @@ class ShopModel |
|
|
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
|
|
|
// 组合搜索分类url
|
|
|
$sortCondition = array();
|
|
|
$sortCondition = $searchCondition['sortCondition'];
|
|
|
$sortCondition['brand'] = self::getShopsBrandIds($shopId);
|
|
|
|
|
|
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
|
|
|
$sortCondition['needSmallSort'] = 1;
|
|
|
}
|
...
|
...
|
@@ -135,6 +139,7 @@ class ShopModel |
|
|
switch ($fun) {
|
|
|
case 'newProducts':
|
|
|
case 'hotProducts':
|
|
|
case 'signboard':
|
|
|
break;
|
|
|
case 'goodsTabBar':
|
|
|
if (isset($list['hot'])) {
|
...
|
...
|
@@ -176,7 +181,7 @@ class ShopModel |
|
|
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
|
|
|
// 组合搜索分类url
|
|
|
$sortCondition = array();
|
|
|
$sortCondition = $searchCondition['sortCondition'];
|
|
|
$sortCondition['brand'] = self::getShopsBrandIds($shopId);
|
|
|
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
|
|
|
$sortCondition['needSmallSort'] = 1;
|
|
|
}
|
...
|
...
|
@@ -715,12 +720,35 @@ class ShopModel |
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取店铺下的品牌
|
|
|
* @param type $shopId 店铺id
|
|
|
* @return type []
|
|
|
*/
|
|
|
public static function getShopsBrands($shopId)
|
|
|
{
|
|
|
return ShopData::getShopsBrands($shopId);
|
|
|
$result = ShopData::getShopsBrands($shopId);
|
|
|
return empty($result['data']) ? array() : $result['data'];
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取店铺下的品牌id
|
|
|
* @param type $shopId 店铺id
|
|
|
* @return array []
|
|
|
*/
|
|
|
public static function getShopsBrandIds($shopId)
|
|
|
{
|
|
|
$brands = array();
|
|
|
$result = self::getShopsBrands($shopId);
|
|
|
if (!empty($result)) {
|
|
|
foreach ($result as $val) {
|
|
|
$brands[] = $val['brand_id'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return implode(',', $brands);
|
|
|
}
|
|
|
|
|
|
public static function getSearch($shopId)
|
|
|
{
|
|
|
return ShopData::getSearch($shopId);
|
...
|
...
|
|