...
|
...
|
@@ -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,7 +222,7 @@ class NewsaleController extends AbstractAction |
|
|
)
|
|
|
|
|
|
)
|
|
|
);
|
|
|
);*/
|
|
|
|
|
|
$this->_view->assign('title', '新品到着');
|
|
|
$this->_view->display('new', $data);
|
...
|
...
|
@@ -254,11 +256,13 @@ class NewsaleController extends AbstractAction |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 折扣专区
|
|
|
*/
|
|
|
public function discountAction()
|
|
|
{
|
|
|
|
|
|
$data = array(
|
|
|
/*$data = array(
|
|
|
'header' => array(
|
|
|
'title' => 'SALE'
|
|
|
),
|
...
|
...
|
@@ -315,9 +319,14 @@ class NewsaleController extends AbstractAction |
|
|
)
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
);*/
|
|
|
|
|
|
/*$this->_view->assign('title', '折扣专区');
|
|
|
$data = array(
|
|
|
'discount' => true,
|
|
|
'header' => array(
|
|
|
'title' => 'SALE'
|
|
|
)
|
|
|
);
|
|
|
|
|
|
// 折扣专区顶部焦点图
|
|
|
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
|
...
|
...
|
@@ -325,20 +334,28 @@ 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($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);
|
...
|
...
|
|