|
@@ -3,7 +3,6 @@ use Action\WebAction; |
|
@@ -3,7 +3,6 @@ use Action\WebAction; |
3
|
use LibModels\Web\Product\FavoriteData;
|
3
|
use LibModels\Web\Product\FavoriteData;
|
4
|
use Product\BrandsModel;
|
4
|
use Product\BrandsModel;
|
5
|
|
5
|
|
6
|
-use LibModels\Web\Product\HotrankData;
|
|
|
7
|
use product\HotrankModel;
|
6
|
use product\HotrankModel;
|
8
|
|
7
|
|
9
|
class IndexController extends WebAction
|
8
|
class IndexController extends WebAction
|
|
@@ -126,7 +125,7 @@ class IndexController extends WebAction |
|
@@ -126,7 +125,7 @@ class IndexController extends WebAction |
126
|
}
|
125
|
}
|
127
|
}
|
126
|
}
|
128
|
|
127
|
|
129
|
- /**
|
128
|
+ /**
|
130
|
* 热销排行
|
129
|
* 热销排行
|
131
|
*/
|
130
|
*/
|
132
|
public function hotrankAction()
|
131
|
public function hotrankAction()
|
|
@@ -134,27 +133,12 @@ class IndexController extends WebAction |
|
@@ -134,27 +133,12 @@ class IndexController extends WebAction |
134
|
//获取频道
|
133
|
//获取频道
|
135
|
$channel = HotrankModel::getChannelResource();
|
134
|
$channel = HotrankModel::getChannelResource();
|
136
|
$this->setWebNavHeader($channel['channel']);
|
135
|
$this->setWebNavHeader($channel['channel']);
|
|
|
136
|
+ $page = $this->get('page',1);
|
|
|
137
|
+ $sort_id = $this->get('sid',0);
|
137
|
$data = array( 'hotrankPage' => true,
|
138
|
$data = array( 'hotrankPage' => true,
|
138
|
'footerTop'=> true,
|
139
|
'footerTop'=> true,
|
139
|
- 'hotrank' => array()
|
140
|
+ 'hotrank' => HotrankModel::HotrankResource($channel,$sort_id,$page)
|
140
|
);
|
141
|
);
|
141
|
-
|
|
|
142
|
- //焦点图 热门品牌
|
|
|
143
|
- $focus = HotrankModel::getFocusResource($channel['channel'], $channel['code']);
|
|
|
144
|
- $data['hotrank']['slide'] = $focus[0]['slide'];
|
|
|
145
|
- $data['hotrank']['hotBrands'] = $focus[1]['hotBrands'];
|
|
|
146
|
-
|
|
|
147
|
- //人气单品 一周热卖
|
|
|
148
|
- $page = $this->get('page',1);
|
|
|
149
|
- $sort_id = $this->get('sid',0);
|
|
|
150
|
- $config = array('sort' =>$sort_id,'gender' => $channel['gender'],'road' => $channel['road']);
|
|
|
151
|
- $publiclist = HotrankModel::getSearchData($config,$page,0);
|
|
|
152
|
- $data['hotrank']['popular'] = $publiclist['popular'];
|
|
|
153
|
- $data['hotrank']['hotWeek'] = $publiclist['hotWeek'];
|
|
|
154
|
-
|
|
|
155
|
- //分类标签
|
|
|
156
|
- $nav = HotrankModel::getHotranktag('web',$channel['road'],true);
|
|
|
157
|
- $data['hotrank']['hotWeek']['nav'] = $nav;
|
|
|
158
|
$this->_view->display('hotrank', $data);
|
142
|
$this->_view->display('hotrank', $data);
|
159
|
}
|
143
|
}
|
160
|
|
144
|
|
|
@@ -171,31 +155,10 @@ class IndexController extends WebAction |
|
@@ -171,31 +155,10 @@ class IndexController extends WebAction |
171
|
exit;
|
155
|
exit;
|
172
|
}
|
156
|
}
|
173
|
$sid = $this->get('sid',1);
|
157
|
$sid = $this->get('sid',1);
|
174
|
- $sort = '';
|
|
|
175
|
- //是否是默认标签
|
|
|
176
|
- if($sid > 1)
|
|
|
177
|
- {
|
|
|
178
|
- //通过ID获取标签信息
|
|
|
179
|
- $info = HotrankData::getTagById($sid, false);
|
|
|
180
|
- if(!empty($info['data']))
|
|
|
181
|
- {
|
|
|
182
|
- $sort = $info['data']['category_id'];
|
|
|
183
|
- }
|
|
|
184
|
- }
|
|
|
185
|
//获取频道资源
|
158
|
//获取频道资源
|
186
|
$channel = HotrankModel::getChannelResource();
|
159
|
$channel = HotrankModel::getChannelResource();
|
187
|
- //一周热卖
|
|
|
188
|
- $config = array('sort' =>$sort,'gender' => $channel['gender'],'road' => $channel['road']);
|
|
|
189
|
- $list = HotrankModel::getSearchData($config, $page, 1);
|
|
|
190
|
- $lister = $list['hotWeek']['list'];
|
|
|
191
|
- $lister = array_values($lister);
|
|
|
192
|
- if($sid == 1 && $page == 1)
|
|
|
193
|
- {
|
|
|
194
|
- $lister = array_slice($lister, 10, 50);
|
|
|
195
|
- }else{
|
|
|
196
|
- $lister = array_slice($lister, 0, 50);
|
|
|
197
|
- }
|
|
|
198
|
- $data = array( 'code'=>200, 'data'=>$lister,);
|
160
|
+ //获取一周热卖资源
|
|
|
161
|
+ $data = HotrankModel::getListData($channel,$sid,$page);
|
199
|
echo json_encode($data);
|
162
|
echo json_encode($data);
|
200
|
exit;
|
163
|
exit;
|
201
|
}
|
164
|
}
|