|
@@ -2,7 +2,7 @@ |
|
@@ -2,7 +2,7 @@ |
2
|
|
2
|
|
3
|
use Action\AbstractAction;
|
3
|
use Action\AbstractAction;
|
4
|
use LibModels\wap\Product\NewsaleData as Newsale;
|
4
|
use LibModels\wap\Product\NewsaleData as Newsale;
|
5
|
-use Plugin\Helpers;
|
5
|
+use Plugin\DataProcess\NewSaleProcess;
|
6
|
/**
|
6
|
/**
|
7
|
* 新品到着
|
7
|
* 新品到着
|
8
|
*/
|
8
|
*/
|
|
@@ -10,7 +10,11 @@ class NewsaleController extends AbstractAction |
|
@@ -10,7 +10,11 @@ class NewsaleController extends AbstractAction |
10
|
{
|
10
|
{
|
11
|
public function indexAction()
|
11
|
public function indexAction()
|
12
|
{
|
12
|
{
|
13
|
- $this->_view->assign('title', '新品到着');
|
13
|
+ $data = array(
|
|
|
14
|
+ 'header' => array(
|
|
|
15
|
+ 'title' => '新品到着'
|
|
|
16
|
+ )
|
|
|
17
|
+ );
|
14
|
|
18
|
|
15
|
// 新品到着顶部焦点图
|
19
|
// 新品到着顶部焦点图
|
16
|
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
|
20
|
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
|
|
@@ -18,58 +22,19 @@ class NewsaleController extends AbstractAction |
|
@@ -18,58 +22,19 @@ class NewsaleController extends AbstractAction |
18
|
$focus = array();
|
22
|
$focus = array();
|
19
|
if($focusData['code'] == 200)
|
23
|
if($focusData['code'] == 200)
|
20
|
{
|
24
|
{
|
21
|
- foreach ($focusData['data'] as $single)
|
|
|
22
|
- {
|
|
|
23
|
- foreach ($single['data'] as $val) {
|
|
|
24
|
- $val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
|
|
|
25
|
- $focus[] = $val;
|
|
|
26
|
- }
|
|
|
27
|
- }
|
25
|
+ $focus = $focusData['data'];
|
28
|
}
|
26
|
}
|
29
|
-
|
|
|
30
|
// 批量获取新品到着商品数据
|
27
|
// 批量获取新品到着商品数据
|
31
|
$products = Newsale::getNewProducts('1,3', 1, 60);
|
28
|
$products = Newsale::getNewProducts('1,3', 1, 60);
|
32
|
|
29
|
|
33
|
- echo '<pre>';
|
|
|
34
|
- print_r($focus);print_r($products);exit;
|
30
|
+ // 添加商品数据
|
|
|
31
|
+ $data += NewSaleProcess::newSaleData($focus, $products);
|
35
|
|
32
|
|
36
|
- $this->_view->display('new', compact('f/**/ocus', 'products'));
|
|
|
37
|
-
|
|
|
38
|
- /*$data = array(
|
|
|
39
|
- 'headerBanner' => array(
|
|
|
40
|
- 'list' => array(
|
|
|
41
|
- array(
|
|
|
42
|
- 'url' => '',
|
|
|
43
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
44
|
- )
|
|
|
45
|
- )
|
|
|
46
|
- ),
|
|
|
47
|
- 'listNav' => array(
|
|
|
48
|
- 'list' => array(
|
|
|
49
|
- array(
|
|
|
50
|
- 'url' => '',
|
|
|
51
|
- 'textCn' => '5月27日',
|
|
|
52
|
- 'styleClass' => ''
|
|
|
53
|
- ),
|
|
|
54
|
- array(
|
|
|
55
|
- 'url' => '',
|
|
|
56
|
- 'textCn' => '本周上新'
|
|
|
57
|
- ),
|
|
|
58
|
- array(
|
|
|
59
|
- 'url' => '',
|
|
|
60
|
- 'textCn' => '销量'
|
|
|
61
|
- ),
|
|
|
62
|
- array(
|
|
|
63
|
- 'url' => '',
|
|
|
64
|
- 'textCn' => '筛选',
|
|
|
65
|
- 'styleClass' => 'screen-nav'
|
|
|
66
|
- )
|
|
|
67
|
- )
|
|
|
68
|
- )
|
|
|
69
|
- );
|
33
|
+ echo '<pre>';
|
|
|
34
|
+ print_r($data);exit;
|
70
|
|
35
|
|
71
|
$this->_view->assign('title', '新品到着');
|
36
|
$this->_view->assign('title', '新品到着');
|
72
|
- $this->_view->display('new', $data);*/
|
37
|
+ $this->_view->display('new', $data);
|
73
|
}
|
38
|
}
|
74
|
|
39
|
|
75
|
|
40
|
|
|
@@ -100,118 +65,17 @@ class NewsaleController extends AbstractAction |
|
@@ -100,118 +65,17 @@ class NewsaleController extends AbstractAction |
100
|
}
|
65
|
}
|
101
|
}
|
66
|
}
|
102
|
|
67
|
|
103
|
-
|
68
|
+ /**
|
|
|
69
|
+ * 折扣专区
|
|
|
70
|
+ */
|
104
|
public function discountAction()
|
71
|
public function discountAction()
|
105
|
{
|
72
|
{
|
106
|
|
73
|
|
107
|
$data = array(
|
74
|
$data = array(
|
108
|
'header' => array(
|
75
|
'header' => array(
|
109
|
- 'title' => 'SALE'
|
|
|
110
|
- ),
|
|
|
111
|
- 'headerBanner' => array(
|
|
|
112
|
- 'list' => array(
|
|
|
113
|
- array(
|
|
|
114
|
- 'url' => '',
|
|
|
115
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
116
|
- ),
|
|
|
117
|
- array(
|
|
|
118
|
- 'url' => '',
|
|
|
119
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
120
|
- ),
|
|
|
121
|
- array(
|
|
|
122
|
- 'url' => '',
|
|
|
123
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
124
|
- ),
|
|
|
125
|
- array(
|
|
|
126
|
- 'url' => '',
|
|
|
127
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
128
|
- )
|
|
|
129
|
- )
|
|
|
130
|
- ),
|
|
|
131
|
- 'saleSection' => array(
|
|
|
132
|
- 'list' => array(
|
|
|
133
|
- array(
|
|
|
134
|
- 'url' => '',
|
|
|
135
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
136
|
- ),
|
|
|
137
|
- array(
|
|
|
138
|
- 'url' => '',
|
|
|
139
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
140
|
- ),
|
|
|
141
|
- array(
|
|
|
142
|
- 'url' => '',
|
|
|
143
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
144
|
- ),
|
|
|
145
|
- array(
|
|
|
146
|
- 'url' => '',
|
|
|
147
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
148
|
- )
|
|
|
149
|
- )
|
|
|
150
|
- ),
|
|
|
151
|
- 'latestSale' => array(
|
|
|
152
|
- 'list' => '最新降价'
|
|
|
153
|
- ),
|
|
|
154
|
- 'goodsNav' => array(
|
|
|
155
|
- 'newPatterns' => true,
|
|
|
156
|
- 'price' => true,
|
|
|
157
|
- 'salesVolume' => true,
|
|
|
158
|
- 'screen' => true,
|
|
|
159
|
- ),
|
|
|
160
|
- 'goodsContainer' => array(
|
|
|
161
|
- 'goods' => array(
|
|
|
162
|
- array(
|
|
|
163
|
- 'id' => '',
|
|
|
164
|
- 'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
165
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
166
|
- 'isLike' => false,
|
|
|
167
|
- 'price' => 1268,
|
|
|
168
|
- 'salePrice' => 589,
|
|
|
169
|
- 'isSale' => true,
|
|
|
170
|
- 'isFew' => true,
|
|
|
171
|
- 'isNew' => false,
|
|
|
172
|
- 'url' => ''
|
|
|
173
|
- ),
|
|
|
174
|
- array(
|
|
|
175
|
- 'id' => '',
|
|
|
176
|
- 'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
177
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
178
|
- 'isLike' => false,
|
|
|
179
|
- 'price' => 1268,
|
|
|
180
|
- 'salePrice' => 589,
|
|
|
181
|
- 'isSale' => true,
|
|
|
182
|
- 'isFew' => true,
|
|
|
183
|
- 'isNew' => false,
|
|
|
184
|
- 'url' => ''
|
|
|
185
|
- ),
|
|
|
186
|
- array(
|
|
|
187
|
- 'id' => '',
|
|
|
188
|
- 'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
189
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
190
|
- 'isLike' => false,
|
|
|
191
|
- 'price' => 1268,
|
|
|
192
|
- 'salePrice' => 589,
|
|
|
193
|
- 'isSale' => true,
|
|
|
194
|
- 'isFew' => true,
|
|
|
195
|
- 'isNew' => false,
|
|
|
196
|
- 'url' => ''
|
|
|
197
|
- ),
|
|
|
198
|
- array(
|
|
|
199
|
- 'id' => '',
|
|
|
200
|
- 'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
201
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
202
|
- 'isLike' => false,
|
|
|
203
|
- 'price' => 1268,
|
|
|
204
|
- 'salePrice' => 589,
|
|
|
205
|
- 'isSale' => true,
|
|
|
206
|
- 'isFew' => true,
|
|
|
207
|
- 'isNew' => false,
|
|
|
208
|
- 'url' => ''
|
|
|
209
|
- )
|
|
|
210
|
- )
|
|
|
211
|
- ),
|
76
|
+ 'title' => '折扣专区'
|
|
|
77
|
+ )
|
212
|
);
|
78
|
);
|
213
|
-
|
|
|
214
|
- /*$this->_view->assign('title', '折扣专区');
|
|
|
215
|
|
79
|
|
216
|
// 折扣专区顶部焦点图
|
80
|
// 折扣专区顶部焦点图
|
217
|
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
|
81
|
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
|
|
@@ -219,22 +83,18 @@ class NewsaleController extends AbstractAction |
|
@@ -219,22 +83,18 @@ class NewsaleController extends AbstractAction |
219
|
$focus = array();
|
83
|
$focus = array();
|
220
|
if($focusData['code'] == 200)
|
84
|
if($focusData['code'] == 200)
|
221
|
{
|
85
|
{
|
222
|
- foreach ($focusData['data'] as $single)
|
|
|
223
|
- {
|
|
|
224
|
- foreach ($single['data'] as $val) {
|
|
|
225
|
- $val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
|
|
|
226
|
- $focus[] = $val;
|
|
|
227
|
- }
|
|
|
228
|
- }
|
86
|
+ $focus = $focusData['data'];
|
229
|
}
|
87
|
}
|
230
|
-
|
|
|
231
|
// 折扣专区商品数据
|
88
|
// 折扣专区商品数据
|
232
|
- $products = Newsale::getNewProducts('1,3', 1, 60);
|
89
|
+ $products = Newsale::getSaleProducts('1,3', 1);
|
233
|
|
90
|
|
234
|
- echo '<pre>';
|
|
|
235
|
- print_r($focus);print_r($products);exit;
|
91
|
+ // 更新tabs
|
|
|
92
|
+ $data += array('tabs' => array_keys($products));
|
|
|
93
|
+ // 添加商品数据
|
|
|
94
|
+ $data += NewSaleProcess::newSaleData($focus, $products);
|
236
|
|
95
|
|
237
|
- $this->_view->display('new', compact('focus', 'products'));*/
|
96
|
+ echo '<pre>';
|
|
|
97
|
+ var_dump($data);exit;
|
238
|
|
98
|
|
239
|
$this->_view->assign('title', '折扣专区');
|
99
|
$this->_view->assign('title', '折扣专区');
|
240
|
$this->_view->display('sale', $data);
|
100
|
$this->_view->display('sale', $data);
|