|
@@ -20,22 +20,20 @@ class NewsaleController extends AbstractAction |
|
@@ -20,22 +20,20 @@ class NewsaleController extends AbstractAction |
20
|
$this->setTitle('新品到着');
|
20
|
$this->setTitle('新品到着');
|
21
|
$this->setNavHeader('新品到着');
|
21
|
$this->setNavHeader('新品到着');
|
22
|
|
22
|
|
23
|
- $channel = $this->get('channel', 1);
|
|
|
24
|
- if (!is_numeric($channel)) {
|
|
|
25
|
- $this->error();
|
|
|
26
|
- }
|
23
|
+ $channel = $this->getCookie('_Channel', 'boys');
|
|
|
24
|
+ $this->channelTrans($channel);
|
27
|
|
25
|
|
28
|
$data = array();
|
26
|
$data = array();
|
29
|
$data['newArrival'] = true;
|
27
|
$data['newArrival'] = true;
|
30
|
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
|
28
|
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
|
31
|
- $goodsList = \Product\NewsaleModel::getNewProducts($channel, 20);
|
29
|
+ $goodsList = \Product\NewsaleModel::getNewProducts($channel, 60);
|
32
|
if (!empty($goodsList)) {
|
30
|
if (!empty($goodsList)) {
|
33
|
$data += $goodsList;
|
31
|
$data += $goodsList;
|
34
|
}
|
32
|
}
|
35
|
// 设置一些筛选的默认参数
|
33
|
// 设置一些筛选的默认参数
|
36
|
$data += array(
|
34
|
$data += array(
|
37
|
'brand' => 0,
|
35
|
'brand' => 0,
|
38
|
- 'sort' => 0,
|
36
|
+ 'msort' => 0,
|
39
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
37
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
40
|
'price' => 0,
|
38
|
'price' => 0,
|
41
|
'size' => 0,
|
39
|
'size' => 0,
|
|
@@ -56,10 +54,8 @@ class NewsaleController extends AbstractAction |
|
@@ -56,10 +54,8 @@ class NewsaleController extends AbstractAction |
56
|
$this->setTitle('折扣专区');
|
54
|
$this->setTitle('折扣专区');
|
57
|
$this->setNavHeader('Sale');
|
55
|
$this->setNavHeader('Sale');
|
58
|
|
56
|
|
59
|
- $channel = $this->get('channel', 1);
|
|
|
60
|
- if (!is_numeric($channel)) {
|
|
|
61
|
- $this->error();
|
|
|
62
|
- }
|
57
|
+ $channel = $this->getCookie('_Channel', 'boys');
|
|
|
58
|
+ $this->channelTrans($channel);
|
63
|
|
59
|
|
64
|
$data = array();
|
60
|
$data = array();
|
65
|
$data['discount'] = true;
|
61
|
$data['discount'] = true;
|
|
@@ -71,7 +67,7 @@ class NewsaleController extends AbstractAction |
|
@@ -71,7 +67,7 @@ class NewsaleController extends AbstractAction |
71
|
// 设置一些筛选的默认参数
|
67
|
// 设置一些筛选的默认参数
|
72
|
$data += array(
|
68
|
$data += array(
|
73
|
'brand' => 0,
|
69
|
'brand' => 0,
|
74
|
- 'sort' => 0,
|
70
|
+ 'msort' => 0,
|
75
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
71
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
76
|
'price' => 0,
|
72
|
'price' => 0,
|
77
|
'size' => 0,
|
73
|
'size' => 0,
|
|
@@ -109,16 +105,16 @@ class NewsaleController extends AbstractAction |
|
@@ -109,16 +105,16 @@ class NewsaleController extends AbstractAction |
109
|
public function selectNewSaleAction()
|
105
|
public function selectNewSaleAction()
|
110
|
{
|
106
|
{
|
111
|
if ($this->isAjax()) {
|
107
|
if ($this->isAjax()) {
|
112
|
- $gender = $this->get('gender', '1,3');
|
108
|
+ $gender = $this->get('gender', 'boys');
|
113
|
$brand = $this->get('brand', null);
|
109
|
$brand = $this->get('brand', null);
|
114
|
- $sort = $this->get('sort', null);
|
110
|
+ $sort = $this->get('msort', null);
|
115
|
$color = $this->get('color', null);
|
111
|
$color = $this->get('color', null);
|
116
|
$size = $this->get('size', null);
|
112
|
$size = $this->get('size', null);
|
117
|
$price = $this->get('price', null);
|
113
|
$price = $this->get('price', null);
|
118
|
- $p_d = $this->get('p_d', null);
|
|
|
119
|
- $channel = $this->get('channel', '1');
|
114
|
+ $p_d = $this->get('discount', null);
|
|
|
115
|
+ $channel = $this->getCookie('_Channel', 'boys');
|
120
|
$dayLimit = $this->get('dayLimit', '1');
|
116
|
$dayLimit = $this->get('dayLimit', '1');
|
121
|
- $limit = $this->get('limit', 20);
|
117
|
+ $limit = $this->get('limit', 60);
|
122
|
$page = $this->get('page', 1);
|
118
|
$page = $this->get('page', 1);
|
123
|
|
119
|
|
124
|
// 转换性别
|
120
|
// 转换性别
|
|
@@ -135,6 +131,9 @@ class NewsaleController extends AbstractAction |
|
@@ -135,6 +131,9 @@ class NewsaleController extends AbstractAction |
135
|
$gender = '1,2,3';
|
131
|
$gender = '1,2,3';
|
136
|
}
|
132
|
}
|
137
|
|
133
|
|
|
|
134
|
+ // 转换频道
|
|
|
135
|
+ $this->channelTrans($channel);
|
|
|
136
|
+
|
138
|
$data = NewsaleData::selectNewSaleProducts(
|
137
|
$data = NewsaleData::selectNewSaleProducts(
|
139
|
$gender, $brand, $sort, $color,
|
138
|
$gender, $brand, $sort, $color,
|
140
|
$size, $price, $p_d, $channel, $dayLimit, $limit, $page
|
139
|
$size, $price, $p_d, $channel, $dayLimit, $limit, $page
|
|
@@ -154,4 +153,28 @@ class NewsaleController extends AbstractAction |
|
@@ -154,4 +153,28 @@ class NewsaleController extends AbstractAction |
154
|
}
|
153
|
}
|
155
|
}
|
154
|
}
|
156
|
|
155
|
|
|
|
156
|
+ /**
|
|
|
157
|
+ * 转换频道
|
|
|
158
|
+ * @param string &$channel 待转换的频道
|
|
|
159
|
+ * @return integer 转换之后的频道
|
|
|
160
|
+ */
|
|
|
161
|
+ private function channelTrans(&$channel)
|
|
|
162
|
+ {
|
|
|
163
|
+ switch ($channel) {
|
|
|
164
|
+ case 'girls':
|
|
|
165
|
+ $channel = 2;
|
|
|
166
|
+ break;
|
|
|
167
|
+ case 'kids':
|
|
|
168
|
+ $channel = 3;
|
|
|
169
|
+ break;
|
|
|
170
|
+ case 'lifestyle':
|
|
|
171
|
+ $channel = 4;
|
|
|
172
|
+ break;
|
|
|
173
|
+ case 'boys':
|
|
|
174
|
+ default:
|
|
|
175
|
+ $channel = 1;
|
|
|
176
|
+ break;
|
|
|
177
|
+ }
|
|
|
178
|
+ }
|
|
|
179
|
+
|
157
|
} |
180
|
} |