|
@@ -29,6 +29,9 @@ class ShopModel |
|
@@ -29,6 +29,9 @@ class ShopModel |
29
|
if (is_callable("self::$fun")) {
|
29
|
if (is_callable("self::$fun")) {
|
30
|
$list = self::$fun(self::getResourceData($list), $parameters);
|
30
|
$list = self::$fun(self::getResourceData($list), $parameters);
|
31
|
switch ($fun) {
|
31
|
switch ($fun) {
|
|
|
32
|
+ case 'signboard':
|
|
|
33
|
+ //过滤不合法的数据
|
|
|
34
|
+ break;
|
32
|
case 'newProducts':
|
35
|
case 'newProducts':
|
33
|
$data['newArrivel']['name'] = '新品上架 NEW';
|
36
|
$data['newArrivel']['name'] = '新品上架 NEW';
|
34
|
$data['newArrivel']['list'] = $list;
|
37
|
$data['newArrivel']['list'] = $list;
|
|
@@ -80,7 +83,8 @@ class ShopModel |
|
@@ -80,7 +83,8 @@ class ShopModel |
80
|
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
|
83
|
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
|
81
|
// 组合搜索分类url
|
84
|
// 组合搜索分类url
|
82
|
$sortCondition = array();
|
85
|
$sortCondition = array();
|
83
|
- $sortCondition = $searchCondition['sortCondition'];
|
86
|
+ $sortCondition['brand'] = self::getShopsBrandIds($shopId);
|
|
|
87
|
+
|
84
|
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
|
88
|
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
|
85
|
$sortCondition['needSmallSort'] = 1;
|
89
|
$sortCondition['needSmallSort'] = 1;
|
86
|
}
|
90
|
}
|
|
@@ -135,6 +139,7 @@ class ShopModel |
|
@@ -135,6 +139,7 @@ class ShopModel |
135
|
switch ($fun) {
|
139
|
switch ($fun) {
|
136
|
case 'newProducts':
|
140
|
case 'newProducts':
|
137
|
case 'hotProducts':
|
141
|
case 'hotProducts':
|
|
|
142
|
+ case 'signboard':
|
138
|
break;
|
143
|
break;
|
139
|
case 'goodsTabBar':
|
144
|
case 'goodsTabBar':
|
140
|
if (isset($list['hot'])) {
|
145
|
if (isset($list['hot'])) {
|
|
@@ -176,7 +181,7 @@ class ShopModel |
|
@@ -176,7 +181,7 @@ class ShopModel |
176
|
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
|
181
|
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
|
177
|
// 组合搜索分类url
|
182
|
// 组合搜索分类url
|
178
|
$sortCondition = array();
|
183
|
$sortCondition = array();
|
179
|
- $sortCondition = $searchCondition['sortCondition'];
|
184
|
+ $sortCondition['brand'] = self::getShopsBrandIds($shopId);
|
180
|
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
|
185
|
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
|
181
|
$sortCondition['needSmallSort'] = 1;
|
186
|
$sortCondition['needSmallSort'] = 1;
|
182
|
}
|
187
|
}
|
|
@@ -715,10 +720,33 @@ class ShopModel |
|
@@ -715,10 +720,33 @@ class ShopModel |
715
|
return $result;
|
720
|
return $result;
|
716
|
}
|
721
|
}
|
717
|
|
722
|
|
718
|
-
|
723
|
+ /**
|
|
|
724
|
+ * 获取店铺下的品牌
|
|
|
725
|
+ * @param type $shopId 店铺id
|
|
|
726
|
+ * @return type []
|
|
|
727
|
+ */
|
719
|
public static function getShopsBrands($shopId)
|
728
|
public static function getShopsBrands($shopId)
|
720
|
{
|
729
|
{
|
721
|
- return ShopData::getShopsBrands($shopId);
|
730
|
+ $result = ShopData::getShopsBrands($shopId);
|
|
|
731
|
+ return empty($result['data']) ? array() : $result['data'];
|
|
|
732
|
+ }
|
|
|
733
|
+
|
|
|
734
|
+ /**
|
|
|
735
|
+ * 获取店铺下的品牌id
|
|
|
736
|
+ * @param type $shopId 店铺id
|
|
|
737
|
+ * @return array []
|
|
|
738
|
+ */
|
|
|
739
|
+ public static function getShopsBrandIds($shopId)
|
|
|
740
|
+ {
|
|
|
741
|
+ $brands = array();
|
|
|
742
|
+ $result = self::getShopsBrands($shopId);
|
|
|
743
|
+ if (!empty($result)) {
|
|
|
744
|
+ foreach ($result as $val) {
|
|
|
745
|
+ $brands[] = $val['brand_id'];
|
|
|
746
|
+ }
|
|
|
747
|
+ }
|
|
|
748
|
+
|
|
|
749
|
+ return implode(',', $brands);
|
722
|
}
|
750
|
}
|
723
|
|
751
|
|
724
|
public static function getSearch($shopId)
|
752
|
public static function getSearch($shopId)
|