|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
use LibModels\Wap\Category\BrandData;
|
|
|
use Plugin\DataProcess\ListProcess;
|
|
|
|
|
|
/**
|
|
|
* 商品列表页
|
|
|
*/
|
|
|
|
|
|
class ListController extends AbstractAction
|
|
|
{
|
|
|
public function indexAction()
|
...
|
...
|
@@ -13,97 +15,72 @@ class ListController extends AbstractAction |
|
|
$data = array(
|
|
|
'goodListPage' => true,
|
|
|
'goodList' => array(
|
|
|
'search' => 'Aape',
|
|
|
'brandWay' => array(
|
|
|
'url' => 'http://aape.m.yohobuy.com/',
|
|
|
'name' => 'Aape',
|
|
|
'thumb' => 'http://img13.static.yhbimg.com/brandLogo/2015/08/26/15/02261f64c198cb4b181c5ef9e61f38f4b9.jpg?imageMogr2/thumbnail/150x70/extent/150x70/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
'new' => array(
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/09/15/03/02e50b1037b45b90aa8f33ee328b18facf.jpg?imageMogr2/thumbnail/290x388/extent/290x388/background/d2hpdGU=/position/center/quality/90',
|
|
|
'url' => '',
|
|
|
'name' => 'Aape X YO’HOOD moon face YOH',
|
|
|
'salePrice' => 599,
|
|
|
'tags' => array(
|
|
|
'is_new' => true,
|
|
|
'is_discount' => true
|
|
|
),
|
|
|
'is_soon_sold_out' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/09/15/03/0101b0c3998752d02724a5512c6efcb241.jpg?imageMogr2/thumbnail/290x388/extent/290x388/background/d2hpdGU=/position/center/quality/90',
|
|
|
'url' => '',
|
|
|
'name' => 'Aape X YO’HOOD moon face YOH',
|
|
|
'salePrice' => 99,
|
|
|
'tags' => array(
|
|
|
'is_yohoood' => true
|
|
|
),
|
|
|
'is_soon_sold_out' => true
|
|
|
)
|
|
|
),
|
|
|
'filter' => array(
|
|
|
array(
|
|
|
'classify' => array(
|
|
|
array(
|
|
|
'title' => '性别',
|
|
|
'name' => '全部性别',
|
|
|
'default' => true,
|
|
|
'subs' => array(
|
|
|
array(
|
|
|
'chosed' => true,
|
|
|
'dataId' => 0,
|
|
|
'name' => '全部性别'
|
|
|
),
|
|
|
array(
|
|
|
'dataId' => 1,
|
|
|
'name' => '男'
|
|
|
),
|
|
|
array(
|
|
|
'dataId' => 3,
|
|
|
'name' => '女'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'title' => '尺寸',
|
|
|
'name' => 'XL',
|
|
|
'subs' => array(
|
|
|
array(
|
|
|
'dataId' => 0,
|
|
|
'name' => '全部尺寸'
|
|
|
),
|
|
|
array(
|
|
|
'dataId' => 1,
|
|
|
'name' => 'S'
|
|
|
),
|
|
|
array(
|
|
|
'dataId' => 2,
|
|
|
'name' => 'M'
|
|
|
),
|
|
|
array(
|
|
|
'dataId' => 3,
|
|
|
'name' => 'L'
|
|
|
),
|
|
|
array(
|
|
|
'chosed' => true,
|
|
|
'dataId' => 4,
|
|
|
'name' => 'XL'
|
|
|
),
|
|
|
array(
|
|
|
'dataId' => 5,
|
|
|
'name' => 'XXL'
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
|
|
|
$brand = $this->get('brand', null);
|
|
|
$gender = $this->get('gender', null);
|
|
|
$p_d = $this->get('p_d', null);
|
|
|
$misort = $this->get('misort', null);
|
|
|
$msort = $this->get('msort', null);
|
|
|
|
|
|
// 查询数据
|
|
|
$listData = SearchData::searchLiDatas(null, $brand, $gender, $p_d, $misort, $msort);
|
|
|
// 处理返回的数据
|
|
|
if (isset($listData['code']) && $listData['code'] == 200) {
|
|
|
$tmpData = $listData['data'];
|
|
|
|
|
|
$data['goodList'] = ListProcess::getListData($tmpData);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
|
|
|
public function brandAction()
|
|
|
{
|
|
|
$brand = $this->get('brand', null);
|
|
|
$gender = $this->get('gender', 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('p_d', null);
|
|
|
|
|
|
$data = array(
|
|
|
'goodListPage' => true,
|
|
|
'goodList' => array(
|
|
|
'brand' => array(
|
|
|
'id' => $brand
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
|
|
|
// 获取品牌介绍信息
|
|
|
$introData = BrandData::getBrandIntro($brand);
|
|
|
if(isset($introData['code']) && $introData['code'] == 200)
|
|
|
{
|
|
|
$data['goodList']['intro'] = isset($introData['data']['brand_intro']) ? $introData['data']['brand_intro'] : '';
|
|
|
}
|
|
|
|
|
|
// 获取品牌banner的数据
|
|
|
$bannerData = BrandData::getBrandBanner($brand, 0);
|
|
|
if(isset($bannerData['code']) && $bannerData['code'] == 200)
|
|
|
{
|
|
|
$data['goodList']['banner'] = isset($bannerData['data']['banner']) ? $bannerData['data']['banner'] : '';
|
|
|
}
|
|
|
|
|
|
// 查询数据
|
|
|
$listData = BrandData::selectBrandDetail($gender, $brand, $sort, $color, $size, $price, $p_d);
|
|
|
// 处理返回的数据
|
|
|
if (isset($listData['code']) && $listData['code'] == 200) {
|
|
|
$tmpData = $listData['data'];
|
|
|
|
|
|
$data['goodList'] = ListProcess::getListData($tmpData);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|