...
|
...
|
@@ -20,7 +20,7 @@ class ListController extends AbstractAction |
|
|
{
|
|
|
$query = $this->get('query', null);
|
|
|
$brand = $this->get('brand', null);
|
|
|
$gender = $this->get('gender', null);
|
|
|
$gender = $this->getCookie('_Channel', 'boys');
|
|
|
$p_d = $this->get('p_d', null);
|
|
|
$misort = $this->get('misort', null);
|
|
|
$msort = $this->get('msort', null);
|
...
|
...
|
@@ -35,7 +35,7 @@ class ListController extends AbstractAction |
|
|
'goodList' => array(
|
|
|
'brand' => 0,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
|
|
'gender' => $gender,
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
|
|
'discount' => ''
|
...
|
...
|
@@ -58,6 +58,9 @@ class ListController extends AbstractAction |
|
|
);
|
|
|
}
|
|
|
|
|
|
// 转换性别
|
|
|
$this->genderTrans($gender);
|
|
|
|
|
|
// 查询数据
|
|
|
$listData = SearchData::searchLiDatas($query, $brand, $gender, $p_d, $misort, $msort);
|
|
|
// 处理返回的数据
|
...
|
...
|
@@ -102,18 +105,7 @@ class ListController extends AbstractAction |
|
|
$sort = $this->get('msort', null);
|
|
|
|
|
|
// 转换性别
|
|
|
if($gender === 'boys')
|
|
|
{
|
|
|
$gender = '1,3';
|
|
|
}
|
|
|
elseif($gender === 'girls')
|
|
|
{
|
|
|
$gender = '2,3';
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
$this->genderTrans($gender);
|
|
|
|
|
|
// 转换排序方式
|
|
|
$order = $this->get('order', null);
|
...
|
...
|
@@ -160,7 +152,7 @@ class ListController extends AbstractAction |
|
|
public function brandAction()
|
|
|
{
|
|
|
$brand = $this->get('brand', null);
|
|
|
$gender = $this->get('gender', null);
|
|
|
$gender = $this->getCookie('_Channel', 'boys');
|
|
|
$sort = $this->get('sort', null);
|
|
|
$color = $this->get('color', null);
|
|
|
$size = $this->get('size', null);
|
...
|
...
|
@@ -179,7 +171,7 @@ class ListController extends AbstractAction |
|
|
),
|
|
|
'brand' => $brand,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', 'boys'),
|
|
|
'gender' => $gender,
|
|
|
'sort' => 0,
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
...
|
...
|
@@ -204,6 +196,8 @@ class ListController extends AbstractAction |
|
|
}
|
|
|
|
|
|
// 查询数据
|
|
|
// 转换性别
|
|
|
$this->genderTrans($gender);
|
|
|
$listData = BrandData::selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
|
|
|
// 处理返回的数据
|
|
|
if (isset($listData['code']) && $listData['code'] === 200) {
|
...
|
...
|
@@ -224,7 +218,7 @@ class ListController extends AbstractAction |
|
|
public function classAction()
|
|
|
{
|
|
|
$brand = $this->get('brand', null);
|
|
|
$gender = $this->get('gender', null);
|
|
|
$gender = $this->getCookie('_Channel', 'boys');
|
|
|
$sort = $this->get('sort', null);
|
|
|
$color = $this->get('color', null);
|
|
|
$size = $this->get('size', null);
|
...
|
...
|
@@ -240,7 +234,7 @@ class ListController extends AbstractAction |
|
|
'goodList' => array(
|
|
|
'brand' => 0,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', '1,3'),
|
|
|
'gender' => $gender,
|
|
|
'sort' => $sort,
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
...
|
...
|
@@ -253,6 +247,8 @@ class ListController extends AbstractAction |
|
|
$data['pageHeader']['navTitle'] = isset($classes[$sort]) ? $classes[$sort] : '';
|
|
|
|
|
|
// 查询数据
|
|
|
// 转换性别
|
|
|
$this->genderTrans($gender);
|
|
|
$listData = ClassData::selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
|
|
|
// 处理返回的数据
|
|
|
if (isset($listData['code']) && $listData['code'] === 200) {
|
...
|
...
|
@@ -264,4 +260,26 @@ class ListController extends AbstractAction |
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 性别数据转换
|
|
|
*
|
|
|
* @param string &$gender 从cookie中获取的gender值,最后得到转换之后接口调用的值
|
|
|
*/
|
|
|
private function genderTrans(&$gender)
|
|
|
{
|
|
|
if($gender === 'boys')
|
|
|
{
|
|
|
$gender = '1,3';
|
|
|
}
|
|
|
elseif($gender === 'girls')
|
|
|
{
|
|
|
$gender = '2,3';
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|