Authored by 周少峰

修改

... ... @@ -59,8 +59,8 @@ class HelperSearch
$result = array();
self::$params = $_GET;
self::$options = $options;
unset(self::$params['/']);
unset(self::$params['page']);
// unset(self::$params['/']);
// unset(self::$params['page']);
self::$filter = isset($data['product']['filter']) ? $data['product']['filter'] : array();
//产品列表
$result['goods'] = isset($data['product']['product_list']) ? self::getProductList($data['product']['product_list'], $options['imgSize']) : array();
... ... @@ -157,7 +157,8 @@ class HelperSearch
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
//筛选符合颜色条件的封面图片
if (isset($params['color']) && $params['color'] == $v['color_id']) {
$val['default_images'] = Images::getImageUrl($v['images_url'],$imgSize[0],$imgSize[1]);
$val['default_images'] = $v['images_url'];
break;
}
}
if (!empty($val['default_images'])) {
... ... @@ -432,7 +433,7 @@ class HelperSearch
else {
$this_brand['index'] = strtolower($v['brand_alif']);
}
//默认品牌
//默认品牌 TODO
if (count($result['default']) < 10) {
$result['default'][] = $this_brand;
}
... ... @@ -440,6 +441,7 @@ class HelperSearch
$brandList[$v['brand_alif']][] = $this_brand;
$brandAll[$v['id']] = $v['brand_name'];
}
// print_r($brandList); exit;
//清空品牌参数
unset($params['brand']);
//设置选中
... ... @@ -450,8 +452,9 @@ class HelperSearch
);
}
ksort($brandList);
//品牌列表排序, 添加品牌索引
//品牌列表排序, 添加品牌索引 TODO
$index_key = array();
// print_r($brandList); exit;
foreach ($brandList as $key => $val) {
if ($key && !in_array($key, $index_key) && !is_numeric($key)) {
$index['index'] = strtolower(($key));
... ... @@ -581,18 +584,17 @@ class HelperSearch
);
}else{
$price = explode(',', $priceId);
if (count($price) == 2) {
if (!$price[0]) {
$price[0] = 0;
}
if (!$price[1]) {
$price[1] = 99999;
}
self::$selected['price'] = array(
'name' => self::$params['price'] == '2000,99999' ? '¥2000以上' : '¥' . (int)$price[0] . '-' . (int)$price[1],
'href' => self::buildurl($params)
);
//TODO
if (!$price[0]) {
$price[0] = 0;
}
if (!$price[1]) {
$price[1] = 99999;
}
self::$selected['price'] = array(
'name' => self::$params['price'] == '2000,99999' ? '¥2000以上' : '¥' . (int)$price[0] . '-' . (int)$price[1],
'href' => self::buildurl($params)
);
}
if (self::checkSearch('price')) {
return array();
... ... @@ -792,7 +794,7 @@ class HelperSearch
}
/**
* 是否新品
* 是否新品 TODO
*/
public static function isnew()
{
... ... @@ -1096,7 +1098,7 @@ class HelperSearch
//组织静态资源数据格式
public static function getNodeContent($code)
{
$nodeContent = BrandData::getByNodeContent($code);
$nodeContent = BrandData::getByNodeContent($code);//TODO异步
if (isset($nodeContent['code']) && $nodeContent['code'] === 200) {
$result = array();
... ... @@ -1288,7 +1290,7 @@ class HelperSearch
/**
* 获取品牌店铺接口地址
* 获取品牌店铺接口地址 TODO
* @param $param
* @return string
*/
... ...
... ... @@ -38,7 +38,7 @@ class IndexModel
$misort = isset($searchCondition['condition']['misort']) ? $searchCondition['condition']['misort'] : false;
$positionId = isset($searchCondition['options']['positionId']) ? $searchCondition['options']['positionId'] : '';
$gender = $searchCondition['condition']['gender'] == '2,3' ? 2 : 1;
if ($msort && $misort) {
if ($msort && $misort) {//TODO
$bannerData = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_TBANNER, 'get', array($positionId,$msort,$misort,$gender,0,0,0,0,0));
if (isset($bannerData['code']) && $bannerData['code'] == '200') {
$banner = self::formatBanner($bannerData['data']);
... ...
... ... @@ -31,37 +31,37 @@ class NewModel
$data = HelperSearch::getList($result, $searchCondition['options']);
//new页面模拟数据
$data['newMain'] = array(
'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200',
'date' => '12月16日',
'title' => '新品到着',
'brands' => array(
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/02/28/15/02b2b5ded161ab31e2e097a327ed475052.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/11/09/09/023721f44182f775d79904010af421331e.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2012/12/13/17/01408fb72646c8f3fa59d870514f08a356.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/12/24/13/0265b45e37af697c5ba12d5415fb341f27.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/11/15/012d09a5cae187af1f6f3ed246b9b5a4fc.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/20/16/01047ffb3ca182871821d551af31ac2378.jpg?imageView/2/w/170/h/120'
)
)
);
// $data['newMain'] = array(
// 'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200',
// 'date' => '12月16日',
// 'title' => '新品到着',
// 'brands' => array(
// array(
// 'href' => '',
// 'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/02/28/15/02b2b5ded161ab31e2e097a327ed475052.jpg?imageView/2/w/170/h/120'
// ),
// array(
// 'href' => '',
// 'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/11/09/09/023721f44182f775d79904010af421331e.jpg?imageView/2/w/170/h/120'
// ),
// array(
// 'href' => '',
// 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2012/12/13/17/01408fb72646c8f3fa59d870514f08a356.jpg?imageView/2/w/170/h/120'
// ),
// array(
// 'href' => '',
// 'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/12/24/13/0265b45e37af697c5ba12d5415fb341f27.jpg?imageView/2/w/170/h/120'
// ),
// array(
// 'href' => '',
// 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/11/15/012d09a5cae187af1f6f3ed246b9b5a4fc.jpg?imageView/2/w/170/h/120'
// ),
// array(
// 'href' => '',
// 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/20/16/01047ffb3ca182871821d551af31ac2378.jpg?imageView/2/w/170/h/120'
// )
// )
// );
return $data;
}
... ...
... ... @@ -20,7 +20,7 @@ class IndexController extends WebAction
}
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
$fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';
$result = BrandsModel::getBrandByDomain($domain, $fields);
$result = BrandsModel::getBrandByDomain($domain, $fields);//TODO
if (!$result) {
$this->go(SITE_MAIN);
}
... ... @@ -33,8 +33,7 @@ class IndexController extends WebAction
$condition['brand'] = isset($result['brandId']) ? $result['brandId'] : '';
//品牌系列参数
$folderId = $this->get('folder_id');
$condition['folder_id'] = $folderId;
$condition['folder_id'] = $this->get('folder_id');
//$options参数数组
$options = array();
... ... @@ -46,6 +45,7 @@ class IndexController extends WebAction
$options['brandNameEn'] = isset($result['brandNameEn']) ? $result['brandNameEn'] : '';
$options['brandNameCn'] = isset($result['brandNameCn']) ? $result['brandNameCn'] : '';
$options['reviewNum'] = 6;
//TODO
$options['controller'] = $this->_request->controller;
$options['action'] = $this->_request->action;
... ... @@ -57,7 +57,7 @@ class IndexController extends WebAction
'searchListPage' => true,
'list' => $data
);
//TODO
$this->setWebNavHeader();
//渲染模板
$this->_view->display('list',$data);
... ... @@ -74,7 +74,7 @@ class IndexController extends WebAction
$uid = $this->getUid();
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页TODO
$fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';
$result = BrandsModel::getBrandByDomain($domain, $fields);
if (!$result) {
... ... @@ -114,7 +114,7 @@ class IndexController extends WebAction
if (!$this->isAjax()) {
return;
}
$uid = $this->post('uid');
//$uid = $this->post('uid');TODO
$brandId = $this->post('brandId');
if ($uid && $brandId) {
... ... @@ -122,7 +122,7 @@ class IndexController extends WebAction
$result = FavoriteData::changeFavoriteBrand($uid, $brandId);
if (isset($result['code']) && $result['code'] == 200) {
$this ->echoJson($result);
}
}//TODO
}
}
... ...
... ... @@ -13,7 +13,7 @@ class ListController extends WebAction
$options = array(
'positionId' => $positionId,
'reviewNum' => 6,
'controller' => $this->_request->controller,
'controller' => $this->_request->controller,//TODO
'action' => $this->_request->action
);
... ... @@ -44,7 +44,7 @@ class ListController extends WebAction
$data = array(
'productListPage' => true,
'newSale' => $newData,
'controller' => $this->_request->controller,
'controller' => $this->_request->controller,//TODO
'action' => $this->_request->action
);
$this->setWebNavHeader();
... ... @@ -67,7 +67,7 @@ class ListController extends WebAction
'productListPage' => true,
'list' => $list,
'controller' => $this->_request->controller,
'action' => $this->_request->action
'action' => $this->_request->action//TODO
);
$this->setWebNavHeader();
$this->_view->display('list', $data);
... ... @@ -83,7 +83,7 @@ class ListController extends WebAction
if (!$this->isAjax()) {
return;
}
$product_skn = $this->post('skn');
$product_skn = $this->post('skn');//TODO
$uid = $this->getUid();
if (!$product_skn) {
... ... @@ -115,7 +115,7 @@ class ListController extends WebAction
}
}
$options['isFavorite'] = $isFavorite;
SearchModel::getProductPic($product_skn, $options);
SearchModel::getProductPic($product_skn, $options);//TODO
}
/**
... ... @@ -134,7 +134,7 @@ class ListController extends WebAction
do {
if (!$product_skn && !$uid) {
break;
break;//TODO
}
if ($isFavorite) {
$result = FavoriteData::delUidProductFav($uid, $product_skn);
... ...
... ... @@ -14,18 +14,22 @@ class SaleController extends WebAction
{
//获取专区ID
$specialsaleId = $this->get('specialsale_id');
$specialInfo = SaleData::getSpecial($specialsaleId);
if(isset($specialInfo['data'])) {
$special = $specialInfo['data'];
} else {
$special = array();
}
//获取促销ID
$promotion = $this->get('promotion');
//专区ID和促销ID都为空时,跳转到主页
if (empty($specialsaleId) && empty($promotion)) {
$this->go(SITE_MAIN);
}
$specialInfo = SaleData::getSpecial($specialsaleId);
print_r($specialInfo);exit;
if(isset($specialInfo['data'])) {
$special = $specialInfo['data'];
} else {
$special = array();
}
$condition = array();
//传品牌ID参数
... ... @@ -40,7 +44,7 @@ class SaleController extends WebAction
}
$options = array(
'controller' => $this->_request->controller,
'controller' => $this->_request->controller,//TODO
'action' => $this->_request->action,
'reviewNum' => 6
);
... ...
... ... @@ -16,6 +16,8 @@ class SearchController extends WebAction
'searchListPage' => true,
'search' => $searchData
);
// $this->setTitle();
// $this->setTitle();
$this->setWebNavHeader();
$this->_view->display('search', $data);
}
... ...