SaleController.php
3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
class SaleController extends QLib_Controller_Adaption_Action
{
public function init() {
}
public function indexAction() {
$this->QLayoutLink()->offsetSetStylesheet(5,$this->_css('goods'));
$params = $this->_request->getParams();
foreach ($params as $key=>$val) {
$params[$key] = QINLib_Utils::Wasc($val);
}
$match = new QINSearch_Tyr_Match('search_outlet', 'search_outlet');
$parameter = $match->getStandardValue($params);
if(!empty($parameter)){
$params['parameter'] = $parameter;
}
//删除outlet的商品
$params['outlets'] = 2;
//每页显示数量
$size = empty($params['num']) ? 59 : ($params['num'] - 1);
//每页显示数
$this->view->num = $size + 1;
//每页显示行数
$this->view->row = empty($params['row']) ? 4 : $params['row'];
//排序
$this->view->order = empty($params['order']) ? '' : $params['order'];
$query = '';
if(empty($params['p_d'])){
$params['p_d'] = '0,0.9';
}
//性别
$this->view->gender = empty($params['gender']) ? '' : $params['gender'];
//颜色
$this->view->color = empty($params['color']) ? 0 : $params['color'];
//完整分页
$paging = $this->helpPaging('Newyoho')->setSize($size);
//排序
$search = $match->search();
$orderParamResult = array();
$filterParamResult = array();
if (empty($params['order'])) {
$search->setMultiOrder();
} else {
$search->setSortModes($params, $orderParamResult);
}
//获得结果
$_result = $search->setFilters($params, $filterParamResult)->setLimits((int)$paging->getNewCurrent(), (int)$paging->getSize())->query();
$filter = array(
'gender' => empty($params['gender']) ? '' : $params['gender'],
'outlets' => 2
);
$filter['p_d'] = '0.1,0.9';
//大分类
$_result['groupSort'] = $match->getSortGroup($filter);
//折扣
$_result['discount'] = $match->getDiscount($filter);
//小分类
$filter['msort'] = empty($params['msort']) ? 0 : $params['msort'];
$filter['misort'] = empty($params['misort']) ? 0 : $params['misort'];
$_result['sort'] = $match->getSmallSort($filter);
//尺码
$_result['size'] = $match->getSize($params);
//颜色
$_result['color'] = $match->getColor($params);
//价格区间
$_result['priceRange'] = $match->priceRange($params);
//品牌
$brandFilter = $params;
if(!empty($brandFilter['brand'])){
unset($brandFilter['brand']);
}
$_result['brand'] = $match->getBrand($brandFilter);
//风格
$styleFilter = $params;
if(!empty($styleFilter['style'])){
unset($styleFilter['style']);
}
$_result['style'] = $match->getStyle($styleFilter);
//命中参数
$_result['param'] = $filterParamResult['_param'];
if(!empty($_result['param']['p_d'])){
unset($_result['param']['p_d']);
}
$this->view->result = $_result;
//分页
$paging->setTotal($_result['total']);
$this->view->paging = $paging;
//mini分页
$this->view->page = $page = $this->helpPaging('newmini')->setTotal($_result['total'])->setSize($size);
//下一页
$this->view->nextpage = $nextpage = $paging->getPageNum() != $paging->getCurrent() ? '/outlet' . $paging->getUrl($paging->getNext()) : '';
$this->view->max_sort_id = !empty($params['msort']) ? $params['msort'] : 0;
$this->view->middle_sort_id = !empty($params['misort']) ? $params['misort'] : 0;
$title = '潮流商品 | YOHO!有货';
$keywords = 'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流';
$description = '潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜';
$this->setMetaInfo($title, $keywords, $description);
}
}