Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
14 changed files
with
199 additions
and
191 deletions
@@ -283,6 +283,9 @@ class AbstractAction extends Controller_Abstract | @@ -283,6 +283,9 @@ class AbstractAction extends Controller_Abstract | ||
283 | */ | 283 | */ |
284 | protected function getUid($useSession = false) | 284 | protected function getUid($useSession = false) |
285 | { | 285 | { |
286 | + // @todo | ||
287 | + $useSession = false; | ||
288 | + | ||
286 | if (!$this->_uid) { | 289 | if (!$this->_uid) { |
287 | $cookie = $this->getCookie('_UID'); | 290 | $cookie = $this->getCookie('_UID'); |
288 | if (!empty($cookie)) { | 291 | if (!empty($cookie)) { |
@@ -53,9 +53,10 @@ class ListProcess | @@ -53,9 +53,10 @@ class ListProcess | ||
53 | * | 53 | * |
54 | * @param $data | 54 | * @param $data |
55 | * @param string | integer $gender 默认选择的性别,默认1,2,3表示所有 | 55 | * @param string | integer $gender 默认选择的性别,默认1,2,3表示所有 |
56 | + * @param null|string $exclude 需要排除的字段 | ||
56 | * @return array 处理之后的筛选数据 | 57 | * @return array 处理之后的筛选数据 |
57 | */ | 58 | */ |
58 | - public static function getFilterData($data, $gender = '1,2,3') | 59 | + public static function getFilterData($data, $gender = '1,2,3', $exclude = null) |
59 | { | 60 | { |
60 | // 过滤条件数据 | 61 | // 过滤条件数据 |
61 | $filters = array('classify' => array()); | 62 | $filters = array('classify' => array()); |
@@ -65,12 +66,10 @@ class ListProcess | @@ -65,12 +66,10 @@ class ListProcess | ||
65 | 66 | ||
66 | $num = 1; | 67 | $num = 1; |
67 | foreach ($data as $key => $val) { | 68 | foreach ($data as $key => $val) { |
68 | - if (empty($val)) { | ||
69 | - continue; | ||
70 | - } | ||
71 | - if (!is_callable("self::$key")) { | 69 | + if ($key === $exclude || empty($val) || !is_callable("self::$key")) { |
72 | continue; | 70 | continue; |
73 | } | 71 | } |
72 | + | ||
74 | $build = self::$key($val, $gender); | 73 | $build = self::$key($val, $gender); |
75 | if ($num === 1) { | 74 | if ($num === 1) { |
76 | $build['active'] = true; | 75 | $build['active'] = true; |
@@ -491,8 +491,10 @@ class Helpers | @@ -491,8 +491,10 @@ class Helpers | ||
491 | return false; | 491 | return false; |
492 | } | 492 | } |
493 | 493 | ||
494 | - //格式化订单商品 | ||
495 | - public static function formatOrderGoods($orderGoods) | 494 | + /** |
495 | + * 格式化订单商品 | ||
496 | + */ | ||
497 | + public static function formatOrderGoods($orderGoods, &$count = 0) | ||
496 | { | 498 | { |
497 | $arr = array(); | 499 | $arr = array(); |
498 | foreach ($orderGoods as $key => $vo) { | 500 | foreach ($orderGoods as $key => $vo) { |
@@ -512,6 +514,8 @@ class Helpers | @@ -512,6 +514,8 @@ class Helpers | ||
512 | if (!empty($vo['expect_arrival_time'])) { | 514 | if (!empty($vo['expect_arrival_time'])) { |
513 | $arr[$key]['appearDate'] = $vo['expect_arrival_time']; | 515 | $arr[$key]['appearDate'] = $vo['expect_arrival_time']; |
514 | } | 516 | } |
517 | + // 累计购买数 | ||
518 | + $count += intval($vo['buy_number']); | ||
515 | } | 519 | } |
516 | return $arr; | 520 | return $arr; |
517 | } | 521 | } |
@@ -17,6 +17,7 @@ var $icon = $('.search-icon'); | @@ -17,6 +17,7 @@ var $icon = $('.search-icon'); | ||
17 | var $form = $('#search-form'); | 17 | var $form = $('#search-form'); |
18 | 18 | ||
19 | var $history = $('.history'); | 19 | var $history = $('.history'); |
20 | +var $historySearch = $('.history-search'); | ||
20 | 21 | ||
21 | var $clearHistory = $('#clear-history'); | 22 | var $clearHistory = $('#clear-history'); |
22 | 23 | ||
@@ -31,6 +32,8 @@ chHammer.on('tap', function() { | @@ -31,6 +32,8 @@ chHammer.on('tap', function() { | ||
31 | localStorage.removeItem('historys'); | 32 | localStorage.removeItem('historys'); |
32 | 33 | ||
33 | $history.html(''); | 34 | $history.html(''); |
35 | + $historySearch.hide(); | ||
36 | + $clearHistory.hide(); | ||
34 | 37 | ||
35 | window.rePosFooter(); | 38 | window.rePosFooter(); |
36 | }); | 39 | }); |
@@ -80,7 +83,7 @@ $('#search').on('touchend', function() { | @@ -80,7 +83,7 @@ $('#search').on('touchend', function() { | ||
80 | 83 | ||
81 | $history.html(html); | 84 | $history.html(html); |
82 | $clearHistory.removeClass('hide'); | 85 | $clearHistory.removeClass('hide'); |
83 | - | 86 | + $historySearch.removeClass('hide'); |
84 | window.rePosFooter(); | 87 | window.rePosFooter(); |
85 | } | 88 | } |
86 | } | 89 | } |
@@ -9,7 +9,7 @@ var $ = require('jquery'), | @@ -9,7 +9,7 @@ var $ = require('jquery'), | ||
9 | 9 | ||
10 | var commentsNum,consultsNum; | 10 | var commentsNum,consultsNum; |
11 | 11 | ||
12 | -var consultFooterEle = document.getElementById('consult-content-footer'), | 12 | +var consultFooterEle = $('.consult-content-footer')[0], |
13 | consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), | 13 | consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), |
14 | 14 | ||
15 | navtabEle = document.getElementById('nav-tab'), | 15 | navtabEle = document.getElementById('nav-tab'), |
@@ -68,13 +68,13 @@ if (navtabHammer) { | @@ -68,13 +68,13 @@ if (navtabHammer) { | ||
68 | 68 | ||
69 | if (consultFooterHammer) { | 69 | if (consultFooterHammer) { |
70 | consultFooterHammer.on('tap', function() { | 70 | consultFooterHammer.on('tap', function() { |
71 | - location.href = $(consultFooterEle).find('a').attr('href'); | 71 | + location.href = $(consultFooterEle).data('href'); |
72 | }); | 72 | }); |
73 | } | 73 | } |
74 | 74 | ||
75 | if (gotoConsultHammer) { | 75 | if (gotoConsultHammer) { |
76 | gotoConsultHammer.on('tap', function() { | 76 | gotoConsultHammer.on('tap', function() { |
77 | - location.href = $(gotoConsultEle).find('a').attr('href'); | 77 | + location.href = $(gotoConsultEle).data('href'); |
78 | }); | 78 | }); |
79 | } | 79 | } |
80 | 80 |
@@ -52,13 +52,13 @@ goodsSwiper = new Swiper('.banner-swiper', { | @@ -52,13 +52,13 @@ goodsSwiper = new Swiper('.banner-swiper', { | ||
52 | 52 | ||
53 | 53 | ||
54 | //初始化goods-discount | 54 | //初始化goods-discount |
55 | -if (0 === $('.goodsDiscount .discount-folder').children().length) { | 55 | +if (0 === $discountFolder.children().length) { |
56 | $discountFolder.css('display', 'none'); | 56 | $discountFolder.css('display', 'none'); |
57 | $discountArrow.html(''); | 57 | $discountArrow.html(''); |
58 | } | 58 | } |
59 | 59 | ||
60 | //goods-discount下拉按钮点击事件 | 60 | //goods-discount下拉按钮点击事件 |
61 | -if (goodsDiscountHammer) { | 61 | +if (goodsDiscountHammer && $discountFolder.children().length > 0) { |
62 | goodsDiscountHammer.on('tap', function(e) { | 62 | goodsDiscountHammer.on('tap', function(e) { |
63 | if ($discountFolder.is(':hidden')) { | 63 | if ($discountFolder.is(':hidden')) { |
64 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); | 64 | $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); |
@@ -67,7 +67,6 @@ if (goodsDiscountHammer) { | @@ -67,7 +67,6 @@ if (goodsDiscountHammer) { | ||
67 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); | 67 | $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); |
68 | $discountFolder.slideUp(); | 68 | $discountFolder.slideUp(); |
69 | } | 69 | } |
70 | - return false; | ||
71 | }); | 70 | }); |
72 | } | 71 | } |
73 | 72 |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | {{/ hot}} | 21 | {{/ hot}} |
22 | </ul> | 22 | </ul> |
23 | </div> | 23 | </div> |
24 | - <div class="history-search"> | 24 | + <div class="history-search hide"> |
25 | <h3>历史搜索</h3> | 25 | <h3>历史搜索</h3> |
26 | <ul class="history clearfix"></ul> | 26 | <ul class="history clearfix"></ul> |
27 | </div> | 27 | </div> |
@@ -29,4 +29,4 @@ | @@ -29,4 +29,4 @@ | ||
29 | </div> | 29 | </div> |
30 | {{/ search}} | 30 | {{/ search}} |
31 | </div> | 31 | </div> |
32 | -{{> layout/footer}} | ||
32 | +{{> layout/footer}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="goods-consults-page yoho-page"> | 2 | <div class="goods-consults-page yoho-page"> |
3 | - <div class="goto-consult" id="goto-consult"> | 3 | + <div class="goto-consult" id="goto-consult" data-href="{{link}}"> |
4 | <i class="iconfont consult-logo"></i> | 4 | <i class="iconfont consult-logo"></i> |
5 | <span>我要咨询</span> | 5 | <span>我要咨询</span> |
6 | - <a href="{{link}}" class="iconfont enter-consult-page"></a> | 6 | + <a href="javascript:;" class="iconfont enter-consult-page"></a> |
7 | </div> | 7 | </div> |
8 | {{# consults}} | 8 | {{# consults}} |
9 | <div class="goods-consults" id="goods-consults"> | 9 | <div class="goods-consults" id="goods-consults"> |
@@ -49,8 +49,8 @@ | @@ -49,8 +49,8 @@ | ||
49 | </div> | 49 | </div> |
50 | {{/ consults}} | 50 | {{/ consults}} |
51 | </div> | 51 | </div> |
52 | - <div class="consult-content-footer" id="consult-content-footer"> | ||
53 | - <a href="{{link}}"> | 52 | + <div class="consult-content-footer" data-href="{{link}}"> |
53 | + <a href="javascript:;"> | ||
54 | 查看更多 | 54 | 查看更多 |
55 | <span class="iconfont"></span></a> | 55 | <span class="iconfont"></span></a> |
56 | </div> | 56 | </div> |
@@ -58,8 +58,9 @@ | @@ -58,8 +58,9 @@ | ||
58 | <div class="consult-content-main content-main no-item"> | 58 | <div class="consult-content-main content-main no-item"> |
59 | <span class="iconfont"></span>暂无咨询 | 59 | <span class="iconfont"></span>暂无咨询 |
60 | </div> | 60 | </div> |
61 | - <div class="consult-content-footer"> | ||
62 | - <a href="{{link}}"> | 61 | + |
62 | + <div class="consult-content-footer" data-href="{{link}}"> | ||
63 | + <a href="javascript:;"> | ||
63 | 我要咨询 | 64 | 我要咨询 |
64 | <span class="iconfont"></span></a> | 65 | <span class="iconfont"></span></a> |
65 | </div> | 66 | </div> |
@@ -32,36 +32,33 @@ class SearchController extends AbstractAction | @@ -32,36 +32,33 @@ class SearchController extends AbstractAction | ||
32 | */ | 32 | */ |
33 | public function listAction() | 33 | public function listAction() |
34 | { | 34 | { |
35 | -// // 过滤请求参数 | ||
36 | -// $condition = filter_input_array(INPUT_GET, array( | ||
37 | -// 'query' => FILTER_DEFAULT, | ||
38 | -// 'brand' => FILTER_DEFAULT, | ||
39 | -// 'sort' => FILTER_DEFAULT, | ||
40 | -// 'msort' => FILTER_DEFAULT, | ||
41 | -// 'misort' => FILTER_DEFAULT, | ||
42 | -// 'color' => FILTER_DEFAULT, | ||
43 | -// 'size' => FILTER_DEFAULT, | ||
44 | -// 'style' => FILTER_DEFAULT, | ||
45 | -// 'price' => FILTER_DEFAULT, | ||
46 | -// 'discount' => FILTER_DEFAULT, | ||
47 | -// 'gender' => FILTER_DEFAULT, | ||
48 | -// 'p_d' => FILTER_DEFAULT,), false); | ||
49 | -// | ||
50 | -// $query = empty($condition['query']) ? null : strtolower(trim($condition['query'])); | ||
51 | -// if (isset($condition['discount'])) { | ||
52 | -// $condition['p_d'] = rawurldecode($condition['discount']); | ||
53 | -// // unset($condition['discount']); 为了兼容js中传参的discount | ||
54 | -// } | ||
55 | -// // 为了兼容现在运营在用的p_d | ||
56 | -// if (isset($condition['p_d'])) { | ||
57 | -// $condition['discount'] = rawurldecode($condition['p_d']); | ||
58 | -// } | ||
59 | -// if (isset($condition['query'])) { | ||
60 | -// $condition['query'] = rawurlencode($condition['query']); | ||
61 | -// } | ||
62 | - | ||
63 | - $query = $this->get('query', ''); | ||
64 | - $query = is_string($query) ? '' : strtolower(trim($query)); | 35 | + // 过滤请求参数 |
36 | + $condition = filter_input_array(INPUT_GET, array( | ||
37 | + 'query' => FILTER_DEFAULT, | ||
38 | + 'brand' => FILTER_DEFAULT, | ||
39 | + 'sort' => FILTER_DEFAULT, | ||
40 | + 'msort' => FILTER_DEFAULT, | ||
41 | + 'misort' => FILTER_DEFAULT, | ||
42 | + 'color' => FILTER_DEFAULT, | ||
43 | + 'size' => FILTER_DEFAULT, | ||
44 | + 'style' => FILTER_DEFAULT, | ||
45 | + 'price' => FILTER_DEFAULT, | ||
46 | + 'discount' => FILTER_DEFAULT, | ||
47 | + 'gender' => FILTER_DEFAULT, | ||
48 | + 'p_d' => FILTER_DEFAULT,), false); | ||
49 | + | ||
50 | + $query = empty($condition['query']) ? null : strtolower(trim($condition['query'])); | ||
51 | + if (isset($condition['discount'])) { | ||
52 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
53 | + // unset($condition['discount']); 为了兼容js中传参的discount | ||
54 | + } | ||
55 | + // 为了兼容现在运营在用的p_d | ||
56 | + if (isset($condition['p_d'])) { | ||
57 | + $condition['discount'] = rawurldecode($condition['p_d']); | ||
58 | + } | ||
59 | + if (isset($condition['query'])) { | ||
60 | + $condition['query'] = rawurlencode($condition['query']); | ||
61 | + } | ||
65 | 62 | ||
66 | // 标识用户是否有输入搜索内容 | 63 | // 标识用户是否有输入搜索内容 |
67 | $haveQuery = $query !== ''; | 64 | $haveQuery = $query !== ''; |
@@ -133,13 +130,13 @@ class SearchController extends AbstractAction | @@ -133,13 +130,13 @@ class SearchController extends AbstractAction | ||
133 | 130 | ||
134 | $classNames = array(); | 131 | $classNames = array(); |
135 | } | 132 | } |
136 | -// else { | ||
137 | -// $condition['query'] = ''; | ||
138 | -// } | 133 | + else { |
134 | + $condition['query'] = ''; | ||
135 | + } | ||
139 | 136 | ||
140 | $data = array(); | 137 | $data = array(); |
141 | $data['goodListPage'] = true; | 138 | $data['goodListPage'] = true; |
142 | - //$data['goodList'] = $condition; | 139 | + $data['goodList'] = $condition; |
143 | $data['query'] = $query; | 140 | $data['query'] = $query; |
144 | // 搜索是一级品类 | 141 | // 搜索是一级品类 |
145 | if ($isQueryFirstClass) { | 142 | if ($isQueryFirstClass) { |
@@ -70,20 +70,21 @@ class OrderModel | @@ -70,20 +70,21 @@ class OrderModel | ||
70 | if (!empty($data['data']['order_list'])) { | 70 | if (!empty($data['data']['order_list'])) { |
71 | // 订单的状态列表 | 71 | // 订单的状态列表 |
72 | //$orderStatus = Helpers::getOrderStatus(); | 72 | //$orderStatus = Helpers::getOrderStatus(); |
73 | - | 73 | + $count = 0; |
74 | foreach ($data['data']['order_list'] as $key => $vo) { | 74 | foreach ($data['data']['order_list'] as $key => $vo) { |
75 | // if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) { | 75 | // if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) { |
76 | // $vo['status'] = 1; | 76 | // $vo['status'] = 1; |
77 | // } | 77 | // } |
78 | + $count = 0; | ||
78 | //订单号,支付状态,订单商品数量,订单总价格 | 79 | //订单号,支付状态,订单商品数量,订单总价格 |
79 | $result[$key]['orderNum'] = $vo['order_code']; | 80 | $result[$key]['orderNum'] = $vo['order_code']; |
80 | //$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ]; | 81 | //$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ]; |
81 | $result[$key]['orderStatus'] = $vo['status_str']; | 82 | $result[$key]['orderStatus'] = $vo['status_str']; |
82 | - $result[$key]['count'] = count($vo['order_goods']); | ||
83 | $result[$key]['sumCost'] = $vo['amount']; | 83 | $result[$key]['sumCost'] = $vo['amount']; |
84 | //类内调用格式化订单商品数据方法 | 84 | //类内调用格式化订单商品数据方法 |
85 | - $result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods']); | 85 | + $result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods'], $count); |
86 | $result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time())); | 86 | $result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time())); |
87 | + $result[$key]['count'] = $count; | ||
87 | //根据订单status判断订单处于什么状态。 | 88 | //根据订单status判断订单处于什么状态。 |
88 | do { | 89 | do { |
89 | //订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。 | 90 | //订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。 |
@@ -304,7 +304,7 @@ class DetailModel | @@ -304,7 +304,7 @@ class DetailModel | ||
304 | /* 参考尺码 */ | 304 | /* 参考尺码 */ |
305 | $boyReference = !empty($sizeInfo['productExtra']['boyReference']); | 305 | $boyReference = !empty($sizeInfo['productExtra']['boyReference']); |
306 | $girlReference = !empty($sizeInfo['productExtra']['girlReference']); | 306 | $girlReference = !empty($sizeInfo['productExtra']['girlReference']); |
307 | - $gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3; | 307 | + $gender = isset($sizeInfo['productDescBo']['gender']) ? $sizeInfo['productDescBo']['gender'] : 3; |
308 | $referenceName = '参考尺码'; | 308 | $referenceName = '参考尺码'; |
309 | if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) { | 309 | if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) { |
310 | $referenceName = '参考尺码'; | 310 | $referenceName = '参考尺码'; |
@@ -87,17 +87,26 @@ class SearchModel | @@ -87,17 +87,26 @@ class SearchModel | ||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | + // 设置选定的gender | ||
91 | + $gender = '1,2,3'; | ||
92 | + if (isset($condition['gender'])) { | ||
93 | + $gender = $condition['gender']; | ||
94 | + } | ||
95 | + | ||
90 | // 区别各种列表页面的筛选数据 | 96 | // 区别各种列表页面的筛选数据 |
91 | if (isset($condition['brand'])) { | 97 | if (isset($condition['brand'])) { |
92 | $listData = BrandData::filterBrandData($condition); | 98 | $listData = BrandData::filterBrandData($condition); |
99 | + $exclude = 'brand'; | ||
93 | } else if (isset($condition['sort'])) { | 100 | } else if (isset($condition['sort'])) { |
94 | $listData = ClassData::filterClassData($condition); | 101 | $listData = ClassData::filterClassData($condition); |
102 | + $exclude = 'group_sort'; | ||
95 | } else { | 103 | } else { |
96 | $listData = SearchData::searchByCondition($condition); | 104 | $listData = SearchData::searchByCondition($condition); |
105 | + $exclude = null; | ||
97 | } | 106 | } |
98 | 107 | ||
99 | if (isset($listData['data']['filter'])) { | 108 | if (isset($listData['data']['filter'])) { |
100 | - $result['filter'] = ListProcess::getFilterData($listData['data']['filter']); | 109 | + $result['filter'] = ListProcess::getFilterData($listData['data']['filter'], $gender, $exclude); |
101 | } | 110 | } |
102 | 111 | ||
103 | if (USE_CACHE) { | 112 | if (USE_CACHE) { |
@@ -23,66 +23,66 @@ class IndexController extends AbstractAction | @@ -23,66 +23,66 @@ class IndexController extends AbstractAction | ||
23 | */ | 23 | */ |
24 | public function indexAction() | 24 | public function indexAction() |
25 | { | 25 | { |
26 | -// // 过滤请求参数 | ||
27 | -// $condition = filter_input_array(INPUT_GET, array( | ||
28 | -// 'brand' => FILTER_DEFAULT, | ||
29 | -// 'sort' => FILTER_DEFAULT, | ||
30 | -// 'msort' => FILTER_DEFAULT, | ||
31 | -// 'misort' => FILTER_DEFAULT, | ||
32 | -// 'color' => FILTER_DEFAULT, | ||
33 | -// 'size' => FILTER_DEFAULT, | ||
34 | -// 'style' => FILTER_DEFAULT, | ||
35 | -// 'price' => FILTER_DEFAULT, | ||
36 | -// 'discount' => FILTER_DEFAULT, | ||
37 | -// 'gender' => FILTER_DEFAULT, | ||
38 | -// 'p_d' => FILTER_DEFAULT,), false); | ||
39 | -// | ||
40 | -// // 转义品牌 | ||
41 | -// if (isset($condition['brand'])) { | ||
42 | -// $condition['brand'] = rawurldecode($condition['brand']); | ||
43 | -// } | ||
44 | -// // 转义分类 | ||
45 | -// if (isset($condition['sort'])) { | ||
46 | -// $condition['sort'] = rawurldecode($condition['sort']); | ||
47 | -// } | ||
48 | -// // 转义一级分类 | ||
49 | -// if (isset($condition['msort'])) { | ||
50 | -// $condition['msort'] = rawurldecode($condition['msort']); | ||
51 | -// } | ||
52 | -// // 转义二级分类 | ||
53 | -// if (isset($condition['misort'])) { | ||
54 | -// $condition['misort'] = rawurldecode($condition['misort']); | ||
55 | -// } | ||
56 | -// // 转义颜色 | ||
57 | -// if (isset($condition['color'])) { | ||
58 | -// $condition['color'] = rawurldecode($condition['color']); | ||
59 | -// } | ||
60 | -// // 转义尺码 | ||
61 | -// if (isset($condition['size'])) { | ||
62 | -// $condition['size'] = rawurldecode($condition['size']); | ||
63 | -// } | ||
64 | -// // 转义风格 | ||
65 | -// if (isset($condition['style'])) { | ||
66 | -// $condition['style'] = rawurldecode($condition['style']); | ||
67 | -// } | ||
68 | -// // 转义价格 | ||
69 | -// if (isset($condition['price'])) { | ||
70 | -// $condition['price'] = rawurldecode($condition['price']); | ||
71 | -// } | ||
72 | -// // 转换折扣 | ||
73 | -// if (isset($condition['discount'])) { | ||
74 | -// $condition['p_d'] = rawurldecode($condition['discount']); | ||
75 | -// } | ||
76 | -// // 为了兼容现在运营在用的p_d | ||
77 | -// if (isset($condition['p_d'])) { | ||
78 | -// $condition['discount'] = rawurldecode($condition['p_d']); | ||
79 | -// } | ||
80 | -// // 性别参数,不传则从COOKIE获取 | ||
81 | -// if (!isset($condition['gender'])) { | ||
82 | -// $condition['gender'] = Helpers::getGenderByCookie(); | ||
83 | -// } else { | ||
84 | -// $condition['gender'] = rawurldecode($condition['gender']); | ||
85 | -// } | 26 | + // 过滤请求参数 |
27 | + $condition = filter_input_array(INPUT_GET, array( | ||
28 | + 'brand' => FILTER_DEFAULT, | ||
29 | + 'sort' => FILTER_DEFAULT, | ||
30 | + 'msort' => FILTER_DEFAULT, | ||
31 | + 'misort' => FILTER_DEFAULT, | ||
32 | + 'color' => FILTER_DEFAULT, | ||
33 | + 'size' => FILTER_DEFAULT, | ||
34 | + 'style' => FILTER_DEFAULT, | ||
35 | + 'price' => FILTER_DEFAULT, | ||
36 | + 'discount' => FILTER_DEFAULT, | ||
37 | + 'gender' => FILTER_DEFAULT, | ||
38 | + 'p_d' => FILTER_DEFAULT,), false); | ||
39 | + | ||
40 | + // 转义品牌 | ||
41 | + if (isset($condition['brand'])) { | ||
42 | + $condition['brand'] = rawurldecode($condition['brand']); | ||
43 | + } | ||
44 | + // 转义分类 | ||
45 | + if (isset($condition['sort'])) { | ||
46 | + $condition['sort'] = rawurldecode($condition['sort']); | ||
47 | + } | ||
48 | + // 转义一级分类 | ||
49 | + if (isset($condition['msort'])) { | ||
50 | + $condition['msort'] = rawurldecode($condition['msort']); | ||
51 | + } | ||
52 | + // 转义二级分类 | ||
53 | + if (isset($condition['misort'])) { | ||
54 | + $condition['misort'] = rawurldecode($condition['misort']); | ||
55 | + } | ||
56 | + // 转义颜色 | ||
57 | + if (isset($condition['color'])) { | ||
58 | + $condition['color'] = rawurldecode($condition['color']); | ||
59 | + } | ||
60 | + // 转义尺码 | ||
61 | + if (isset($condition['size'])) { | ||
62 | + $condition['size'] = rawurldecode($condition['size']); | ||
63 | + } | ||
64 | + // 转义风格 | ||
65 | + if (isset($condition['style'])) { | ||
66 | + $condition['style'] = rawurldecode($condition['style']); | ||
67 | + } | ||
68 | + // 转义价格 | ||
69 | + if (isset($condition['price'])) { | ||
70 | + $condition['price'] = rawurldecode($condition['price']); | ||
71 | + } | ||
72 | + // 转换折扣 | ||
73 | + if (isset($condition['discount'])) { | ||
74 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
75 | + } | ||
76 | + // 为了兼容现在运营在用的p_d | ||
77 | + if (isset($condition['p_d'])) { | ||
78 | + $condition['discount'] = rawurldecode($condition['p_d']); | ||
79 | + } | ||
80 | + // 性别参数,不传则从COOKIE获取 | ||
81 | + if (!isset($condition['gender'])) { | ||
82 | + $condition['gender'] = Helpers::getGenderByCookie(); | ||
83 | + } else { | ||
84 | + $condition['gender'] = rawurldecode($condition['gender']); | ||
85 | + } | ||
86 | 86 | ||
87 | // 品类名称参数, 不传则默认为全部 | 87 | // 品类名称参数, 不传则默认为全部 |
88 | $name = $this->get('sort_name'); | 88 | $name = $this->get('sort_name'); |
@@ -92,11 +92,10 @@ class IndexController extends AbstractAction | @@ -92,11 +92,10 @@ class IndexController extends AbstractAction | ||
92 | $this->setTitle($name); | 92 | $this->setTitle($name); |
93 | $this->setNavHeader($name, true, SITE_MAIN); | 93 | $this->setNavHeader($name, true, SITE_MAIN); |
94 | 94 | ||
95 | -// if (!$condition) { | ||
96 | -// $condition = array(); | ||
97 | -// } | ||
98 | -// $goodList = $condition; | ||
99 | - $goodList = array(); | 95 | + if (!$condition) { |
96 | + $condition = array(); | ||
97 | + } | ||
98 | + $goodList = $condition; | ||
100 | $goodList['cartUrl'] = Helpers::url('/cart/index/index', null); | 99 | $goodList['cartUrl'] = Helpers::url('/cart/index/index', null); |
101 | 100 | ||
102 | $this->_view->display('index', array( | 101 | $this->_view->display('index', array( |
@@ -133,13 +132,6 @@ class IndexController extends AbstractAction | @@ -133,13 +132,6 @@ class IndexController extends AbstractAction | ||
133 | $brandId = $brandLogo['id']; | 132 | $brandId = $brandLogo['id']; |
134 | } | 133 | } |
135 | 134 | ||
136 | - /* 通过品牌域名找到对应的品牌ID */ | ||
137 | -// $domainList = Product\ListModel::getAllBrandDomains(); | ||
138 | -// $brandIds = array_keys($domainList, $domain); | ||
139 | -// $brandId = 0; | ||
140 | -// if (isset($brandIds[0])) { | ||
141 | -// $brandId = $brandIds[0]; | ||
142 | -// } | ||
143 | // 当前的登录用户UID | 135 | // 当前的登录用户UID |
144 | $uid = $this->getUid(); | 136 | $uid = $this->getUid(); |
145 | 137 | ||
@@ -147,64 +139,64 @@ class IndexController extends AbstractAction | @@ -147,64 +139,64 @@ class IndexController extends AbstractAction | ||
147 | $from = $this->get('from'); | 139 | $from = $this->get('from'); |
148 | $query = $this->get('query'); | 140 | $query = $this->get('query'); |
149 | 141 | ||
150 | -// /* 过滤请求参数 */ | ||
151 | -// $condition = filter_input_array(INPUT_GET, array( | ||
152 | -// 'sort' => FILTER_DEFAULT, | ||
153 | -// 'msort' => FILTER_DEFAULT, | ||
154 | -// 'misort' => FILTER_DEFAULT, | ||
155 | -// 'color' => FILTER_DEFAULT, | ||
156 | -// 'size' => FILTER_DEFAULT, | ||
157 | -// 'style' => FILTER_DEFAULT, | ||
158 | -// 'price' => FILTER_DEFAULT, | ||
159 | -// 'discount' => FILTER_DEFAULT, | ||
160 | -// 'gender' => FILTER_DEFAULT, | ||
161 | -// 'p_d' => FILTER_DEFAULT,), false); | ||
162 | -// $condition['brand'] = $brandId; | ||
163 | -// // 转义分类 | ||
164 | -// if (isset($condition['sort'])) { | ||
165 | -// $condition['sort'] = rawurldecode($condition['sort']); | ||
166 | -// } | ||
167 | -// // 转义一级分类 | ||
168 | -// if (isset($condition['msort'])) { | ||
169 | -// $condition['msort'] = rawurldecode($condition['msort']); | ||
170 | -// } | ||
171 | -// // 转义二级分类 | ||
172 | -// if (isset($condition['misort'])) { | ||
173 | -// $condition['misort'] = rawurldecode($condition['misort']); | ||
174 | -// } | ||
175 | -// // 转义颜色 | ||
176 | -// if (isset($condition['color'])) { | ||
177 | -// $condition['color'] = rawurldecode($condition['color']); | ||
178 | -// } | ||
179 | -// // 转义尺码 | ||
180 | -// if (isset($condition['size'])) { | ||
181 | -// $condition['size'] = rawurldecode($condition['size']); | ||
182 | -// } | ||
183 | -// // 转义风格 | ||
184 | -// if (isset($condition['style'])) { | ||
185 | -// $condition['style'] = rawurldecode($condition['style']); | ||
186 | -// } | ||
187 | -// // 转义价格 | ||
188 | -// if (isset($condition['price'])) { | ||
189 | -// $condition['price'] = rawurldecode($condition['price']); | ||
190 | -// } | ||
191 | -// // 转换折扣 | ||
192 | -// if (isset($condition['discount'])) { | ||
193 | -// $condition['p_d'] = rawurldecode($condition['discount']); | ||
194 | -// } | ||
195 | -// // 为了兼容现在运营在用的p_d | ||
196 | -// if (isset($condition['p_d'])) { | ||
197 | -// $condition['discount'] = rawurldecode($condition['p_d']); | ||
198 | -// } | ||
199 | -// if ($brandId === 0) { | ||
200 | -// $condition['query'] = $domain; | ||
201 | -// } | ||
202 | -// | ||
203 | -// if (isset($condition['gender'])) { | ||
204 | -// $condition['gender'] = rawurldecode($condition['gender']); | ||
205 | -// } else { | ||
206 | -// $condition['gender'] = Helpers::getGenderByCookie(); | ||
207 | -// } | 142 | + /* 过滤请求参数 */ |
143 | + $condition = filter_input_array(INPUT_GET, array( | ||
144 | + 'sort' => FILTER_DEFAULT, | ||
145 | + 'msort' => FILTER_DEFAULT, | ||
146 | + 'misort' => FILTER_DEFAULT, | ||
147 | + 'color' => FILTER_DEFAULT, | ||
148 | + 'size' => FILTER_DEFAULT, | ||
149 | + 'style' => FILTER_DEFAULT, | ||
150 | + 'price' => FILTER_DEFAULT, | ||
151 | + 'discount' => FILTER_DEFAULT, | ||
152 | + 'gender' => FILTER_DEFAULT, | ||
153 | + 'p_d' => FILTER_DEFAULT,), false); | ||
154 | + $condition['brand'] = $brandId; | ||
155 | + // 转义分类 | ||
156 | + if (isset($condition['sort'])) { | ||
157 | + $condition['sort'] = rawurldecode($condition['sort']); | ||
158 | + } | ||
159 | + // 转义一级分类 | ||
160 | + if (isset($condition['msort'])) { | ||
161 | + $condition['msort'] = rawurldecode($condition['msort']); | ||
162 | + } | ||
163 | + // 转义二级分类 | ||
164 | + if (isset($condition['misort'])) { | ||
165 | + $condition['misort'] = rawurldecode($condition['misort']); | ||
166 | + } | ||
167 | + // 转义颜色 | ||
168 | + if (isset($condition['color'])) { | ||
169 | + $condition['color'] = rawurldecode($condition['color']); | ||
170 | + } | ||
171 | + // 转义尺码 | ||
172 | + if (isset($condition['size'])) { | ||
173 | + $condition['size'] = rawurldecode($condition['size']); | ||
174 | + } | ||
175 | + // 转义风格 | ||
176 | + if (isset($condition['style'])) { | ||
177 | + $condition['style'] = rawurldecode($condition['style']); | ||
178 | + } | ||
179 | + // 转义价格 | ||
180 | + if (isset($condition['price'])) { | ||
181 | + $condition['price'] = rawurldecode($condition['price']); | ||
182 | + } | ||
183 | + // 转换折扣 | ||
184 | + if (isset($condition['discount'])) { | ||
185 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
186 | + } | ||
187 | + // 为了兼容现在运营在用的p_d | ||
188 | + if (isset($condition['p_d'])) { | ||
189 | + $condition['discount'] = rawurldecode($condition['p_d']); | ||
190 | + } | ||
191 | + if ($brandId === 0) { | ||
192 | + $condition['query'] = $domain; | ||
193 | + } | ||
194 | + | ||
195 | + if (isset($condition['gender'])) { | ||
196 | + $condition['gender'] = rawurldecode($condition['gender']); | ||
197 | + } else { | ||
198 | + $condition['gender'] = Helpers::getGenderByCookie(); | ||
199 | + } | ||
208 | 200 | ||
209 | $data = array(); | 201 | $data = array(); |
210 | $data['goodListPage'] = true; | 202 | $data['goodListPage'] = true; |
-
Please register or login to post a comment