|
@@ -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,13 @@ class NewsaleController extends AbstractAction |
|
@@ -10,7 +10,13 @@ class NewsaleController extends AbstractAction |
10
|
{
|
10
|
{
|
11
|
public function indexAction()
|
11
|
public function indexAction()
|
12
|
{
|
12
|
{
|
13
|
- /*$this->_view->assign('title', '新品到着');
|
13
|
+
|
|
|
14
|
+ $data = array(
|
|
|
15
|
+ 'newArrival' => true,
|
|
|
16
|
+ 'header' => array(
|
|
|
17
|
+ 'title' => '新品到着'
|
|
|
18
|
+ )
|
|
|
19
|
+ );
|
14
|
|
20
|
|
15
|
// 新品到着顶部焦点图
|
21
|
// 新品到着顶部焦点图
|
16
|
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
|
22
|
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
|
|
@@ -18,22 +24,18 @@ class NewsaleController extends AbstractAction |
|
@@ -18,22 +24,18 @@ class NewsaleController extends AbstractAction |
18
|
$focus = array();
|
24
|
$focus = array();
|
19
|
if($focusData['code'] == 200)
|
25
|
if($focusData['code'] == 200)
|
20
|
{
|
26
|
{
|
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
|
- }
|
27
|
+ $focus = $focusData['data'];
|
28
|
}
|
28
|
}
|
29
|
|
29
|
|
30
|
// 批量获取新品到着商品数据
|
30
|
// 批量获取新品到着商品数据
|
31
|
$products = Newsale::getNewProducts('1,3', 1, 60);
|
31
|
$products = Newsale::getNewProducts('1,3', 1, 60);
|
32
|
- var_dump($focus);
|
32
|
+ // 添加商品数据
|
|
|
33
|
+ $data += NewSaleProcess::newSaleData($focus, $products);
|
33
|
|
34
|
|
34
|
- $this->_view->display('new', compact('focus', 'products'));*/
|
35
|
+ /*echo '<pre>';
|
|
|
36
|
+ print_r($data);exit;*/
|
35
|
|
37
|
|
36
|
- $data = array(
|
38
|
+ /*$data = array(
|
37
|
'headerBanner' => array(
|
39
|
'headerBanner' => array(
|
38
|
'list' => array(
|
40
|
'list' => array(
|
39
|
array(
|
41
|
array(
|
|
@@ -220,22 +222,21 @@ class NewsaleController extends AbstractAction |
|
@@ -220,22 +222,21 @@ class NewsaleController extends AbstractAction |
220
|
)
|
222
|
)
|
221
|
|
223
|
|
222
|
)
|
224
|
)
|
223
|
- );
|
225
|
+ );*/
|
224
|
|
226
|
|
225
|
$this->_view->assign('title', '新品到着');
|
227
|
$this->_view->assign('title', '新品到着');
|
226
|
$this->_view->display('new', $data);
|
228
|
$this->_view->display('new', $data);
|
227
|
}
|
229
|
}
|
228
|
|
230
|
|
229
|
-
|
|
|
230
|
/**
|
231
|
/**
|
231
|
* Ajax方式筛选新品到着、折扣专区商品
|
232
|
* Ajax方式筛选新品到着、折扣专区商品
|
232
|
*
|
233
|
*
|
233
|
* @return array 根据指定条件筛选之后的商品
|
234
|
* @return array 根据指定条件筛选之后的商品
|
234
|
*/
|
235
|
*/
|
235
|
- public function selectNewAction()
|
|
|
236
|
- {
|
|
|
237
|
- if($this->isAjax())
|
236
|
+ public function selectNewSaleAction()
|
238
|
{
|
237
|
{
|
|
|
238
|
+ /*if($this->isAjax())
|
|
|
239
|
+ {*/
|
239
|
$gender = $this->get('gender', '1,3');
|
240
|
$gender = $this->get('gender', '1,3');
|
240
|
$brand = $this->get('brand', null);
|
241
|
$brand = $this->get('brand', null);
|
241
|
$sort = $this->get('sort', null);
|
242
|
$sort = $this->get('sort', null);
|
|
@@ -250,52 +251,28 @@ class NewsaleController extends AbstractAction |
|
@@ -250,52 +251,28 @@ class NewsaleController extends AbstractAction |
250
|
|
251
|
|
251
|
$data = Newsale::selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page);
|
252
|
$data = Newsale::selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page);
|
252
|
|
253
|
|
253
|
- $this->returnJson(200, '获取成功', $data);
|
|
|
254
|
- }
|
|
|
255
|
- }
|
254
|
+ $result = NewSaleProcess::selectData($data);
|
256
|
|
255
|
|
|
|
256
|
+ $this->_view->display('product', $result);
|
|
|
257
|
+ // $this->returnJson(200, '获取成功', $data);
|
|
|
258
|
+ // }
|
|
|
259
|
+ }
|
257
|
|
260
|
|
|
|
261
|
+ /**
|
|
|
262
|
+ * 折扣专区
|
|
|
263
|
+ */
|
258
|
public function discountAction()
|
264
|
public function discountAction()
|
259
|
{
|
265
|
{
|
260
|
|
266
|
|
261
|
- $data = array(
|
|
|
262
|
- 'headerBanner' => array(
|
|
|
263
|
- 'url' => '',
|
|
|
264
|
- 'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
265
|
- ),
|
|
|
266
|
- 'tabs' => array(
|
|
|
267
|
- array(
|
|
|
268
|
- 'title' => '1-3折',
|
|
|
269
|
- 'focus' => true
|
|
|
270
|
- ),
|
|
|
271
|
- array(
|
|
|
272
|
- 'title' => '4-6折'
|
|
|
273
|
- ),
|
|
|
274
|
- array(
|
|
|
275
|
- 'title' => '7-9折'
|
|
|
276
|
- ),
|
|
|
277
|
- array(
|
|
|
278
|
- 'title' => 'ALL'
|
|
|
279
|
- )
|
267
|
+ /*$data = array(
|
|
|
268
|
+ 'header' => array(
|
|
|
269
|
+ 'title' => 'SALE'
|
280
|
),
|
270
|
),
|
|
|
271
|
+
|
281
|
'goodsContainer' => array(
|
272
|
'goodsContainer' => array(
|
282
|
- array(
|
|
|
283
|
- 'show' => 'true',
|
|
|
284
|
'goods' => array(
|
273
|
'goods' => array(
|
285
|
array(
|
274
|
array(
|
286
|
'id' => '',
|
275
|
'id' => '',
|
287
|
- 'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
288
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
289
|
- 'isLike' => false,
|
|
|
290
|
- 'price' => 1268,
|
|
|
291
|
- 'salePrice' => 589,
|
|
|
292
|
- 'isSale' => true,
|
|
|
293
|
- 'isFew' => true,
|
|
|
294
|
- 'isNew' => false,
|
|
|
295
|
- 'url' => ''
|
|
|
296
|
- ),
|
|
|
297
|
- array(
|
|
|
298
|
- 'id' => '',
|
|
|
299
|
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
276
|
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
300
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
277
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
301
|
'isLike' => false,
|
278
|
'isLike' => false,
|
|
@@ -329,105 +306,10 @@ class NewsaleController extends AbstractAction |
|
@@ -329,105 +306,10 @@ class NewsaleController extends AbstractAction |
329
|
'isFew' => true,
|
306
|
'isFew' => true,
|
330
|
'isNew' => false,
|
307
|
'isNew' => false,
|
331
|
'url' => ''
|
308
|
'url' => ''
|
332
|
- )
|
|
|
333
|
-
|
|
|
334
|
- )
|
|
|
335
|
- ),
|
|
|
336
|
- array(
|
|
|
337
|
- 'goods' => array(
|
|
|
338
|
- array(
|
|
|
339
|
- 'id' => '',
|
|
|
340
|
- 'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
341
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
342
|
- 'isLike' => false,
|
|
|
343
|
- 'price' => 1268,
|
|
|
344
|
- 'salePrice' => 589,
|
|
|
345
|
- 'isSale' => true,
|
|
|
346
|
- 'isFew' => true,
|
|
|
347
|
- 'isNew' => false,
|
|
|
348
|
- 'url' => ''
|
|
|
349
|
- ),
|
|
|
350
|
- array(
|
|
|
351
|
- 'id' => '',
|
|
|
352
|
- 'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
353
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
354
|
- 'isLike' => false,
|
|
|
355
|
- 'price' => 1268,
|
|
|
356
|
- 'salePrice' => 589,
|
|
|
357
|
- 'isSale' => true,
|
|
|
358
|
- 'isFew' => true,
|
|
|
359
|
- 'isNew' => false,
|
|
|
360
|
- 'url' => ''
|
|
|
361
|
- ),
|
|
|
362
|
- array(
|
|
|
363
|
- 'id' => '',
|
|
|
364
|
- 'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
365
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
366
|
- 'isLike' => false,
|
|
|
367
|
- 'price' => 1268,
|
|
|
368
|
- 'salePrice' => 589,
|
|
|
369
|
- 'isSale' => true,
|
|
|
370
|
- 'isFew' => true,
|
|
|
371
|
- 'isNew' => false,
|
|
|
372
|
- 'url' => ''
|
|
|
373
|
- ),
|
|
|
374
|
- array(
|
|
|
375
|
- 'id' => '',
|
|
|
376
|
- 'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
377
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
378
|
- 'isLike' => false,
|
|
|
379
|
- 'price' => 1268,
|
|
|
380
|
- 'salePrice' => 589,
|
|
|
381
|
- 'isSale' => true,
|
|
|
382
|
- 'isFew' => true,
|
|
|
383
|
- 'isNew' => false,
|
|
|
384
|
- 'url' => ''
|
|
|
385
|
- )
|
|
|
386
|
-
|
|
|
387
|
- )
|
|
|
388
|
-
|
|
|
389
|
- ),
|
|
|
390
|
- array(
|
|
|
391
|
- 'goods' => array(
|
|
|
392
|
- array(
|
|
|
393
|
- 'id' => '',
|
|
|
394
|
- 'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
395
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
396
|
- 'isLike' => false,
|
|
|
397
|
- 'price' => 1268,
|
|
|
398
|
- 'salePrice' => 589,
|
|
|
399
|
- 'isSale' => true,
|
|
|
400
|
- 'isFew' => true,
|
|
|
401
|
- 'isNew' => false,
|
|
|
402
|
- 'url' => ''
|
|
|
403
|
),
|
309
|
),
|
404
|
array(
|
310
|
array(
|
405
|
'id' => '',
|
311
|
'id' => '',
|
406
|
- 'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
407
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
408
|
- 'isLike' => false,
|
|
|
409
|
- 'price' => 1268,
|
|
|
410
|
- 'salePrice' => 589,
|
|
|
411
|
- 'isSale' => true,
|
|
|
412
|
- 'isFew' => true,
|
|
|
413
|
- 'isNew' => false,
|
|
|
414
|
- 'url' => ''
|
|
|
415
|
- ),
|
|
|
416
|
- array(
|
|
|
417
|
- 'id' => '',
|
|
|
418
|
- 'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
419
|
- 'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
420
|
- 'isLike' => false,
|
|
|
421
|
- 'price' => 1268,
|
|
|
422
|
- 'salePrice' => 589,
|
|
|
423
|
- 'isSale' => true,
|
|
|
424
|
- 'isFew' => true,
|
|
|
425
|
- 'isNew' => false,
|
|
|
426
|
- 'url' => ''
|
|
|
427
|
- ),
|
|
|
428
|
- array(
|
|
|
429
|
- 'id' => '',
|
|
|
430
|
- 'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
312
|
+ 'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
431
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
313
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
432
|
'isLike' => false,
|
314
|
'isLike' => false,
|
433
|
'price' => 1268,
|
315
|
'price' => 1268,
|
|
@@ -437,37 +319,45 @@ class NewsaleController extends AbstractAction |
|
@@ -437,37 +319,45 @@ class NewsaleController extends AbstractAction |
437
|
'isNew' => false,
|
319
|
'isNew' => false,
|
438
|
'url' => ''
|
320
|
'url' => ''
|
439
|
)
|
321
|
)
|
440
|
-
|
|
|
441
|
)
|
322
|
)
|
442
|
-
|
|
|
443
|
-
|
|
|
444
|
)
|
323
|
)
|
|
|
324
|
+ );*/
|
445
|
|
325
|
|
|
|
326
|
+ $data = array(
|
|
|
327
|
+ 'discount' => true,
|
|
|
328
|
+ 'header' => array(
|
|
|
329
|
+ 'title' => 'SALE'
|
446
|
)
|
330
|
)
|
447
|
);
|
331
|
);
|
448
|
|
332
|
|
449
|
- /*$this->_view->assign('title', '折扣专区');
|
|
|
450
|
-
|
|
|
451
|
// 折扣专区顶部焦点图
|
333
|
// 折扣专区顶部焦点图
|
452
|
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
|
334
|
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
|
453
|
// 处理返回的数据
|
335
|
// 处理返回的数据
|
454
|
$focus = array();
|
336
|
$focus = array();
|
455
|
if($focusData['code'] == 200)
|
337
|
if($focusData['code'] == 200)
|
456
|
{
|
338
|
{
|
457
|
- foreach ($focusData['data'] as $single)
|
|
|
458
|
- {
|
|
|
459
|
- foreach ($single['data'] as $val) {
|
|
|
460
|
- $val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
|
|
|
461
|
- $focus[] = $val;
|
|
|
462
|
- }
|
|
|
463
|
- }
|
339
|
+ $focus = $focusData['data'];
|
464
|
}
|
340
|
}
|
465
|
|
341
|
|
466
|
// 折扣专区商品数据
|
342
|
// 折扣专区商品数据
|
467
|
- $products = Newsale::getNewProducts('1,3', 1, 60);
|
|
|
468
|
- var_dump($products);
|
343
|
+ $products = Newsale::getSaleProducts('1,3', 1);
|
|
|
344
|
+ // 更新tabs
|
|
|
345
|
+ $tabs = array();
|
|
|
346
|
+ foreach (array_keys($products) as $key => $value) {
|
|
|
347
|
+ $tabItem = array();
|
|
|
348
|
+ $tabItem['title'] = $value;
|
|
|
349
|
+ if($key === 0)
|
|
|
350
|
+ {
|
|
|
351
|
+ $tabItem['focus'] = true;
|
|
|
352
|
+ }
|
|
|
353
|
+ $tabs[] = $tabItem;
|
|
|
354
|
+ }
|
|
|
355
|
+ $data += array('tabs' => $tabs);
|
|
|
356
|
+ // 添加商品数据
|
|
|
357
|
+ $data += NewSaleProcess::newSaleData($focus, $products);
|
469
|
|
358
|
|
470
|
- $this->_view->display('new', compact('focus', 'products'));*/
|
359
|
+ echo '<pre>';
|
|
|
360
|
+ print_r($data);exit;
|
471
|
|
361
|
|
472
|
$this->_view->assign('title', '折扣专区');
|
362
|
$this->_view->assign('title', '折扣专区');
|
473
|
$this->_view->display('sale', $data);
|
363
|
$this->_view->display('sale', $data);
|