...
|
...
|
@@ -78,7 +78,7 @@ class NewsaleController extends AbstractAction |
|
|
public function selectNewSaleAction()
|
|
|
{
|
|
|
if ($this->isAjax()) {
|
|
|
$gender = $this->get('gender', 'boys');
|
|
|
$gender = $this->get('gender', null);
|
|
|
$brand = $this->get('brand', null);
|
|
|
$sort = $this->get('sort', null);
|
|
|
$color = $this->get('color', null);
|
...
|
...
|
@@ -89,30 +89,10 @@ class NewsaleController extends AbstractAction |
|
|
$limit = $this->get('limit', 60);
|
|
|
$page = $this->get('page', 1);
|
|
|
|
|
|
// 转换性别
|
|
|
if ($gender === 'boys') {
|
|
|
$gender = '1,3';
|
|
|
} elseif ($gender === 'girls') {
|
|
|
$gender = '2,3';
|
|
|
} else {
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
|
|
|
// 转换排序方式
|
|
|
$order = $this->get('order', null);
|
|
|
$orderVal = $this->get('order', null);
|
|
|
$type = $this->get('type', '');
|
|
|
switch ($type) {
|
|
|
case 'price':
|
|
|
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
|
|
|
break;
|
|
|
case 'discount':
|
|
|
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
|
|
|
break;
|
|
|
case 'newest':
|
|
|
default:
|
|
|
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
|
|
|
break;
|
|
|
}
|
|
|
$order = Helpers::transOrder($orderVal, $type);
|
|
|
|
|
|
// 转换频道
|
|
|
$channel = Helpers::getChannelByCookie();
|
...
|
...
|
@@ -132,4 +112,45 @@ class NewsaleController extends AbstractAction |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Ajax方式查询筛选数据
|
|
|
*
|
|
|
* @return array 筛选数据
|
|
|
*/
|
|
|
public function filterAction()
|
|
|
{
|
|
|
if ($this->isAjax()) {
|
|
|
$gender = $this->get('gender', null);
|
|
|
$brand = $this->get('brand', null);
|
|
|
$sort = $this->get('sort', null);
|
|
|
$color = $this->get('color', null);
|
|
|
$size = $this->get('size', null);
|
|
|
$price = $this->get('price', null);
|
|
|
$p_d = $this->get('discount', null);
|
|
|
$dayLimit = $this->get('dayLimit', null);
|
|
|
$limit = $this->get('limit', 60);
|
|
|
$page = $this->get('page', 1);
|
|
|
|
|
|
// 转换排序方式
|
|
|
$orderVal = $this->get('order', null);
|
|
|
$type = $this->get('type', '');
|
|
|
$order = Helpers::transOrder($orderVal, $type);
|
|
|
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
|
|
|
$data = NewsaleData::selectNewSaleProducts(
|
|
|
$gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
|
|
|
);
|
|
|
$result = \Product\NewsaleModel::filterData($data);
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->_view->display('filter', $result);
|
|
|
}
|
|
|
} else {
|
|
|
echo ' ';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|