...
|
...
|
@@ -4,6 +4,7 @@ use Action\AbstractAction; |
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
use LibModels\Wap\Category\BrandData;
|
|
|
use LibModels\Wap\Category\ClassData;
|
|
|
use Category\ClassModel;
|
|
|
use Plugin\DataProcess\ListProcess;
|
|
|
use Plugin\Helpers;
|
|
|
|
...
|
...
|
@@ -31,11 +32,28 @@ class ListController extends AbstractAction |
|
|
'navHome' => '/'
|
|
|
),
|
|
|
'goodListPage' => true,
|
|
|
'goodList' => array()
|
|
|
'goodList' => array(
|
|
|
'brand' => 0,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', '1,2'),
|
|
|
'sort' => 0,
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
|
|
'discount' => '',
|
|
|
'p_d' => ''
|
|
|
)
|
|
|
);
|
|
|
|
|
|
// 首先查询是否属于内置品类
|
|
|
$classes = ClassModel::getClassesArr();
|
|
|
$classFlag = array_search($query, $classes);
|
|
|
if($classFlag !== false)// 属于内部品类
|
|
|
{
|
|
|
$data['pageHeader']['navTitle'] = '所有'.$query;
|
|
|
}
|
|
|
|
|
|
// 如果存在搜索字符串就显示搜索栏
|
|
|
if(!is_null($query))
|
|
|
if(!is_null($query) && $classFlag === false)
|
|
|
{
|
|
|
$data['search'] = array(
|
|
|
'default' => $query
|
...
|
...
|
@@ -57,9 +75,12 @@ class ListController extends AbstractAction |
|
|
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
|
|
|
'name' => $brandData['brand_name']
|
|
|
);
|
|
|
|
|
|
// 设置品牌默认值
|
|
|
$data['goodList']['brand'] = $brandData['id'];
|
|
|
}
|
|
|
|
|
|
$data['goodList'] = ListProcess::getListData($tmpData);
|
|
|
$data['goodList'] += ListProcess::getListData($tmpData);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
...
|
...
|
@@ -80,6 +101,22 @@ class ListController extends AbstractAction |
|
|
$misort = $this->get('misort', null);
|
|
|
$msort = $this->get('msort', null);
|
|
|
|
|
|
// 转换性别
|
|
|
if($gender === 'boys')
|
|
|
{
|
|
|
$gender = '1,2';
|
|
|
}
|
|
|
elseif($gender === 'girls')
|
|
|
{
|
|
|
$gender = '2,3';
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
|
|
|
|
|
|
// 转换排序方式
|
|
|
$order = $this->get('order', null);
|
|
|
$type = $this->get('type', '');
|
|
|
switch ($type) {
|
...
|
...
|
@@ -138,9 +175,17 @@ class ListController extends AbstractAction |
|
|
),
|
|
|
'goodListPage' => true,
|
|
|
'goodList' => array(
|
|
|
'brand' => array(
|
|
|
'brandHome' => array(
|
|
|
'id' => $brand
|
|
|
)
|
|
|
),
|
|
|
'brand' => $brand,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', '1,2'),
|
|
|
'sort' => 0,
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
|
|
'discount' => '',
|
|
|
'p_d' => ''
|
|
|
)
|
|
|
);
|
|
|
|
...
|
...
|
@@ -148,14 +193,15 @@ class ListController extends AbstractAction |
|
|
$introData = BrandData::getBrandIntro($brand);
|
|
|
if(isset($introData['code']) && $introData['code'] === 200)
|
|
|
{
|
|
|
$data['goodList']['brand']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : '';
|
|
|
$data['goodList']['brandHome']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : '';
|
|
|
}
|
|
|
|
|
|
// 获取品牌banner的数据
|
|
|
$bannerData = BrandData::getBrandBanner($brand, 0);
|
|
|
$uid = $this->getUid();
|
|
|
$bannerData = BrandData::getBrandBanner($brand, $uid);
|
|
|
if(isset($bannerData['code']) && $bannerData['code'] === 200)
|
|
|
{
|
|
|
$data['goodList']['brand']['banner'] = isset($bannerData['data']['banner']) ? Helpers::getImageUrl($bannerData['data']['banner'], 640, 75) : '';
|
|
|
$data['goodList']['brandHome']['banner'] = isset($bannerData['data']['banner']) ? Helpers::getImageUrl($bannerData['data']['banner'], 640, 75) : '';
|
|
|
}
|
|
|
|
|
|
// 查询数据
|
...
|
...
|
@@ -192,16 +238,29 @@ class ListController extends AbstractAction |
|
|
'navHome' => '/'
|
|
|
),
|
|
|
'goodListPage' => true,
|
|
|
'goodList' => array()
|
|
|
'goodList' => array(
|
|
|
'brand' => 0,
|
|
|
'msort' => 0,
|
|
|
'gender' => $this->getCookie('_Channel', '1,2'),
|
|
|
'sort' => $sort,
|
|
|
'price' => 0,
|
|
|
'size' => 0,
|
|
|
'discount' => '',
|
|
|
'p_d' => ''
|
|
|
)
|
|
|
);
|
|
|
|
|
|
// 根据id查询类的名称
|
|
|
$classes = ClassModel::getClassesArr();
|
|
|
$data['pageHeader']['navTitle'] = isset($classes[$sort]) ? $classes[$sort] : '';
|
|
|
|
|
|
// 查询数据
|
|
|
$listData = ClassData::selectClassDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
|
|
|
// 处理返回的数据
|
|
|
if (isset($listData['code']) && $listData['code'] === 200) {
|
|
|
$tmpData = $listData['data'];
|
|
|
|
|
|
$data['goodList'] = ListProcess::getListData($tmpData);
|
|
|
$data['goodList'] += ListProcess::getListData($tmpData);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
...
|
...
|
|