...
|
...
|
@@ -20,22 +20,20 @@ class NewsaleController extends AbstractAction |
|
|
$this->setTitle('新品到着');
|
|
|
$this->setNavHeader('新品到着');
|
|
|
|
|
|
$channel = $this->get('channel', 1);
|
|
|
if (!is_numeric($channel)) {
|
|
|
$this->error();
|
|
|
}
|
|
|
$channel = $this->getCookie('_Channel', 'boys');
|
|
|
$this->channelTrans($channel);
|
|
|
|
|
|
$data = array();
|
|
|
$data['newArrival'] = true;
|
|
|
$data['headerBanner'] = \Product\NewsaleModel::getNewFocus($channel);
|
|
|
$goodsList = \Product\NewsaleModel::getNewProducts($channel, 20);
|
|
|
$goodsList = \Product\NewsaleModel::getNewProducts($channel, 60);
|
|
|
if (!empty($goodsList)) {
|
|
|
$data += $goodsList;
|
|
|
}
|
|
|
// 设置一些筛选的默认参数
|
|
|
$data += array(
|
|
|
'brand' => 0,
|
|
|
'sort' => 0,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
...
|
...
|
@@ -56,10 +54,8 @@ class NewsaleController extends AbstractAction |
|
|
$this->setTitle('折扣专区');
|
|
|
$this->setNavHeader('Sale');
|
|
|
|
|
|
$channel = $this->get('channel', 1);
|
|
|
if (!is_numeric($channel)) {
|
|
|
$this->error();
|
|
|
}
|
|
|
$channel = $this->getCookie('_Channel', 'boys');
|
|
|
$this->channelTrans($channel);
|
|
|
|
|
|
$data = array();
|
|
|
$data['discount'] = true;
|
...
|
...
|
@@ -71,7 +67,7 @@ class NewsaleController extends AbstractAction |
|
|
// 设置一些筛选的默认参数
|
|
|
$data += array(
|
|
|
'brand' => 0,
|
|
|
'sort' => 0,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
...
|
...
|
@@ -109,16 +105,16 @@ class NewsaleController extends AbstractAction |
|
|
public function selectNewSaleAction()
|
|
|
{
|
|
|
if ($this->isAjax()) {
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
$gender = $this->get('gender', 'boys');
|
|
|
$brand = $this->get('brand', null);
|
|
|
$sort = $this->get('sort', null);
|
|
|
$sort = $this->get('msort', null);
|
|
|
$color = $this->get('color', null);
|
|
|
$size = $this->get('size', null);
|
|
|
$price = $this->get('price', null);
|
|
|
$p_d = $this->get('p_d', null);
|
|
|
$channel = $this->get('channel', '1');
|
|
|
$p_d = $this->get('discount', null);
|
|
|
$channel = $this->getCookie('_Channel', 'boys');
|
|
|
$dayLimit = $this->get('dayLimit', '1');
|
|
|
$limit = $this->get('limit', 20);
|
|
|
$limit = $this->get('limit', 60);
|
|
|
$page = $this->get('page', 1);
|
|
|
|
|
|
// 转换性别
|
...
|
...
|
@@ -135,6 +131,9 @@ class NewsaleController extends AbstractAction |
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
|
|
|
// 转换频道
|
|
|
$this->channelTrans($channel);
|
|
|
|
|
|
$data = NewsaleData::selectNewSaleProducts(
|
|
|
$gender, $brand, $sort, $color,
|
|
|
$size, $price, $p_d, $channel, $dayLimit, $limit, $page
|
...
|
...
|
@@ -154,4 +153,28 @@ class NewsaleController extends AbstractAction |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 转换频道
|
|
|
* @param string &$channel 待转换的频道
|
|
|
* @return integer 转换之后的频道
|
|
|
*/
|
|
|
private function channelTrans(&$channel)
|
|
|
{
|
|
|
switch ($channel) {
|
|
|
case 'girls':
|
|
|
$channel = 2;
|
|
|
break;
|
|
|
case 'kids':
|
|
|
$channel = 3;
|
|
|
break;
|
|
|
case 'lifestyle':
|
|
|
$channel = 4;
|
|
|
break;
|
|
|
case 'boys':
|
|
|
default:
|
|
|
$channel = 1;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|