...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\wap\Product\NewsaleData as Newsale;
|
|
|
use Plugin\Helpers;
|
|
|
use Plugin\DataProcess\NewSaleProcess;
|
|
|
/**
|
|
|
* 新品到着
|
|
|
*/
|
...
|
...
|
@@ -10,7 +10,13 @@ class NewsaleController extends AbstractAction |
|
|
{
|
|
|
public function indexAction()
|
|
|
{
|
|
|
/*$this->_view->assign('title', '新品到着');
|
|
|
|
|
|
$data = array(
|
|
|
'newArrival' => true,
|
|
|
'header' => array(
|
|
|
'title' => '新品到着'
|
|
|
)
|
|
|
);
|
|
|
|
|
|
// 新品到着顶部焦点图
|
|
|
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
|
...
|
...
|
@@ -18,22 +24,18 @@ class NewsaleController extends AbstractAction |
|
|
$focus = array();
|
|
|
if($focusData['code'] == 200)
|
|
|
{
|
|
|
foreach ($focusData['data'] as $single)
|
|
|
{
|
|
|
foreach ($single['data'] as $val) {
|
|
|
$val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
|
|
|
$focus[] = $val;
|
|
|
}
|
|
|
}
|
|
|
$focus = $focusData['data'];
|
|
|
}
|
|
|
|
|
|
// 批量获取新品到着商品数据
|
|
|
$products = Newsale::getNewProducts('1,3', 1, 60);
|
|
|
var_dump($focus);
|
|
|
// 添加商品数据
|
|
|
$data += NewSaleProcess::newSaleData($focus, $products);
|
|
|
|
|
|
$this->_view->display('new', compact('focus', 'products'));*/
|
|
|
/*echo '<pre>';
|
|
|
print_r($data);exit;*/
|
|
|
|
|
|
$data = array(
|
|
|
/*$data = array(
|
|
|
'headerBanner' => array(
|
|
|
'list' => array(
|
|
|
array(
|
...
|
...
|
@@ -220,22 +222,21 @@ class NewsaleController extends AbstractAction |
|
|
)
|
|
|
|
|
|
)
|
|
|
);
|
|
|
);*/
|
|
|
|
|
|
$this->_view->assign('title', '新品到着');
|
|
|
$this->_view->display('new', $data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Ajax方式筛选新品到着、折扣专区商品
|
|
|
*
|
|
|
* @return array 根据指定条件筛选之后的商品
|
|
|
*/
|
|
|
public function selectNewAction()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
public function selectNewSaleAction()
|
|
|
{
|
|
|
/*if($this->isAjax())
|
|
|
{*/
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
$brand = $this->get('brand', null);
|
|
|
$sort = $this->get('sort', null);
|
...
|
...
|
@@ -250,52 +251,28 @@ class NewsaleController extends AbstractAction |
|
|
|
|
|
$data = Newsale::selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page);
|
|
|
|
|
|
$this->returnJson(200, '获取成功', $data);
|
|
|
}
|
|
|
}
|
|
|
$result = NewSaleProcess::selectData($data);
|
|
|
|
|
|
$this->_view->display('product', $result);
|
|
|
// $this->returnJson(200, '获取成功', $data);
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 折扣专区
|
|
|
*/
|
|
|
public function discountAction()
|
|
|
{
|
|
|
|
|
|
$data = array(
|
|
|
'headerBanner' => array(
|
|
|
'url' => '',
|
|
|
'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480'
|
|
|
),
|
|
|
'tabs' => array(
|
|
|
array(
|
|
|
'title' => '1-3折',
|
|
|
'focus' => true
|
|
|
),
|
|
|
array(
|
|
|
'title' => '4-6折'
|
|
|
),
|
|
|
array(
|
|
|
'title' => '7-9折'
|
|
|
),
|
|
|
array(
|
|
|
'title' => 'ALL'
|
|
|
)
|
|
|
/*$data = array(
|
|
|
'header' => array(
|
|
|
'title' => 'SALE'
|
|
|
),
|
|
|
|
|
|
'goodsContainer' => array(
|
|
|
array(
|
|
|
'show' => 'true',
|
|
|
'goods' => array(
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
...
|
...
|
@@ -329,105 +306,10 @@ class NewsaleController extends AbstractAction |
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
)
|
|
|
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'goods' => array(
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
)
|
|
|
|
|
|
)
|
|
|
|
|
|
),
|
|
|
array(
|
|
|
'goods' => array(
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
|
|
'salePrice' => 589,
|
|
|
'isSale' => true,
|
|
|
'isFew' => true,
|
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
),
|
|
|
array(
|
|
|
'id' => '',
|
|
|
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
|
|
|
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
|
|
|
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
|
|
|
'isLike' => false,
|
|
|
'price' => 1268,
|
...
|
...
|
@@ -437,37 +319,45 @@ class NewsaleController extends AbstractAction |
|
|
'isNew' => false,
|
|
|
'url' => ''
|
|
|
)
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
)
|
|
|
);*/
|
|
|
|
|
|
$data = array(
|
|
|
'discount' => true,
|
|
|
'header' => array(
|
|
|
'title' => 'SALE'
|
|
|
)
|
|
|
);
|
|
|
|
|
|
/*$this->_view->assign('title', '折扣专区');
|
|
|
|
|
|
// 折扣专区顶部焦点图
|
|
|
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
|
|
|
// 处理返回的数据
|
|
|
$focus = array();
|
|
|
if($focusData['code'] == 200)
|
|
|
{
|
|
|
foreach ($focusData['data'] as $single)
|
|
|
{
|
|
|
foreach ($single['data'] as $val) {
|
|
|
$val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
|
|
|
$focus[] = $val;
|
|
|
}
|
|
|
}
|
|
|
$focus = $focusData['data'];
|
|
|
}
|
|
|
|
|
|
// 折扣专区商品数据
|
|
|
$products = Newsale::getNewProducts('1,3', 1, 60);
|
|
|
var_dump($products);
|
|
|
$products = Newsale::getSaleProducts('1,3', 1);
|
|
|
// 更新tabs
|
|
|
$tabs = array();
|
|
|
foreach (array_keys($products) as $key => $value) {
|
|
|
$tabItem = array();
|
|
|
$tabItem['title'] = $value;
|
|
|
if($key === 0)
|
|
|
{
|
|
|
$tabItem['focus'] = true;
|
|
|
}
|
|
|
$tabs[] = $tabItem;
|
|
|
}
|
|
|
$data += array('tabs' => $tabs);
|
|
|
// 添加商品数据
|
|
|
$data += NewSaleProcess::newSaleData($focus, $products);
|
|
|
|
|
|
$this->_view->display('new', compact('focus', 'products'));*/
|
|
|
echo '<pre>';
|
|
|
print_r($data);exit;
|
|
|
|
|
|
$this->_view->assign('title', '折扣专区');
|
|
|
$this->_view->display('sale', $data);
|
...
|
...
|
|