Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
db4e1d5a7a4b29cb16e9dd77dfce7de6b29b479f
2 parents
260172df
f3a855ff
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
199 additions
and
191 deletions
library/Action/AbstractAction.php
library/Plugin/DataProcess/ListProcess.php
library/Plugin/Helpers.php
static/js/index/search.js
static/js/product/detail/comments-consults.js
static/js/product/detail/detail.js
template/m.yohobuy.com/actions/index/search/index.phtml
template/m.yohobuy.com/actions/product/detail/consults.phtml
template/m.yohobuy.com/partials/product/feedback-tab.phtml
yohobuy/m.yohobuy.com/application/controllers/Search.php
yohobuy/m.yohobuy.com/application/models/Home/Order.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/models/Product/Search.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
library/Action/AbstractAction.php
View file @
db4e1d5
...
...
@@ -283,6 +283,9 @@ class AbstractAction extends Controller_Abstract
*/
protected
function
getUid
(
$useSession
=
false
)
{
// @todo
$useSession
=
false
;
if
(
!
$this
->
_uid
)
{
$cookie
=
$this
->
getCookie
(
'_UID'
);
if
(
!
empty
(
$cookie
))
{
...
...
library/Plugin/DataProcess/ListProcess.php
View file @
db4e1d5
...
...
@@ -53,9 +53,10 @@ class ListProcess
*
* @param $data
* @param string | integer $gender 默认选择的性别,默认1,2,3表示所有
* @param null|string $exclude 需要排除的字段
* @return array 处理之后的筛选数据
*/
public
static
function
getFilterData
(
$data
,
$gender
=
'1,2,3'
)
public
static
function
getFilterData
(
$data
,
$gender
=
'1,2,3'
,
$exclude
=
null
)
{
// 过滤条件数据
$filters
=
array
(
'classify'
=>
array
());
...
...
@@ -65,12 +66,10 @@ class ListProcess
$num
=
1
;
foreach
(
$data
as
$key
=>
$val
)
{
if
(
empty
(
$val
))
{
continue
;
}
if
(
!
is_callable
(
"self::
$key
"
))
{
if
(
$key
===
$exclude
||
empty
(
$val
)
||
!
is_callable
(
"self::
$key
"
))
{
continue
;
}
$build
=
self
::
$key
(
$val
,
$gender
);
if
(
$num
===
1
)
{
$build
[
'active'
]
=
true
;
...
...
library/Plugin/Helpers.php
View file @
db4e1d5
...
...
@@ -491,8 +491,10 @@ class Helpers
return
false
;
}
//格式化订单商品
public
static
function
formatOrderGoods
(
$orderGoods
)
/**
* 格式化订单商品
*/
public
static
function
formatOrderGoods
(
$orderGoods
,
&
$count
=
0
)
{
$arr
=
array
();
foreach
(
$orderGoods
as
$key
=>
$vo
)
{
...
...
@@ -512,6 +514,8 @@ class Helpers
if
(
!
empty
(
$vo
[
'expect_arrival_time'
]))
{
$arr
[
$key
][
'appearDate'
]
=
$vo
[
'expect_arrival_time'
];
}
// 累计购买数
$count
+=
intval
(
$vo
[
'buy_number'
]);
}
return
$arr
;
}
...
...
static/js/index/search.js
View file @
db4e1d5
...
...
@@ -17,6 +17,7 @@ var $icon = $('.search-icon');
var
$form
=
$
(
'#search-form'
);
var
$history
=
$
(
'.history'
);
var
$historySearch
=
$
(
'.history-search'
);
var
$clearHistory
=
$
(
'#clear-history'
);
...
...
@@ -31,6 +32,8 @@ chHammer.on('tap', function() {
localStorage
.
removeItem
(
'historys'
);
$history
.
html
(
''
);
$historySearch
.
hide
();
$clearHistory
.
hide
();
window
.
rePosFooter
();
});
...
...
@@ -80,7 +83,7 @@ $('#search').on('touchend', function() {
$history
.
html
(
html
);
$clearHistory
.
removeClass
(
'hide'
);
$historySearch
.
removeClass
(
'hide'
);
window
.
rePosFooter
();
}
}
...
...
static/js/product/detail/comments-consults.js
View file @
db4e1d5
...
...
@@ -9,7 +9,7 @@ var $ = require('jquery'),
var
commentsNum
,
consultsNum
;
var
consultFooterEle
=
document
.
getElementById
(
'consult-content-footer'
)
,
var
consultFooterEle
=
$
(
'.consult-content-footer'
)[
0
]
,
consultFooterHammer
=
consultFooterEle
&&
new
Hammer
(
consultFooterEle
),
navtabEle
=
document
.
getElementById
(
'nav-tab'
),
...
...
@@ -68,13 +68,13 @@ if (navtabHammer) {
if
(
consultFooterHammer
)
{
consultFooterHammer
.
on
(
'tap'
,
function
()
{
location
.
href
=
$
(
consultFooterEle
).
find
(
'a'
).
attr
(
'href'
);
location
.
href
=
$
(
consultFooterEle
).
data
(
'href'
);
});
}
if
(
gotoConsultHammer
)
{
gotoConsultHammer
.
on
(
'tap'
,
function
()
{
location
.
href
=
$
(
gotoConsultEle
).
find
(
'a'
).
attr
(
'href'
);
location
.
href
=
$
(
gotoConsultEle
).
data
(
'href'
);
});
}
...
...
static/js/product/detail/detail.js
View file @
db4e1d5
...
...
@@ -52,13 +52,13 @@ goodsSwiper = new Swiper('.banner-swiper', {
//初始化goods-discount
if
(
0
===
$
(
'.goodsDiscount .discount-folder'
)
.
children
().
length
)
{
if
(
0
===
$
discountFolder
.
children
().
length
)
{
$discountFolder
.
css
(
'display'
,
'none'
);
$discountArrow
.
html
(
''
);
}
//goods-discount下拉按钮点击事件
if
(
goodsDiscountHammer
)
{
if
(
goodsDiscountHammer
&&
$discountFolder
.
children
().
length
>
0
)
{
goodsDiscountHammer
.
on
(
'tap'
,
function
(
e
)
{
if
(
$discountFolder
.
is
(
':hidden'
))
{
$discountArrow
.
removeClass
(
'icon-down'
).
addClass
(
'icon-up'
).
html
(
''
);
...
...
@@ -67,7 +67,6 @@ if (goodsDiscountHammer) {
$discountArrow
.
removeClass
(
'icon-up'
).
addClass
(
'icon-down'
).
html
(
''
);
$discountFolder
.
slideUp
();
}
return
false
;
});
}
...
...
template/m.yohobuy.com/actions/index/search/index.phtml
View file @
db4e1d5
...
...
@@ -21,7 +21,7 @@
{
{/
hot
}
}
</ul>
</div>
<div
class=
"history-search"
>
<div
class=
"history-search
hide
"
>
<h
3
>历史搜索</h
3
>
<ul
class=
"history clearfix"
></ul>
</div>
...
...
@@ -29,4 +29,4 @@
</div>
{
{/
search
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/actions/product/detail/consults.phtml
View file @
db4e1d5
{
{>
layout/header
}
}
<div
class=
"goods-consults-page yoho-page"
>
<div
class=
"goto-consult"
id=
"goto-consult"
>
<div
class=
"goto-consult"
id=
"goto-consult"
data-href=
"{{link}}"
>
<i
class=
"iconfont consult-logo"
>
639
;</i>
<span>我要咨询</span>
<a
href=
"
{{link}}
"
class=
"iconfont enter-consult-page"
>
604
;</a>
<a
href=
"
javascript:;
"
class=
"iconfont enter-consult-page"
>
604
;</a>
</div>
{
{#
consults
}
}
<div
class=
"goods-consults"
id=
"goods-consults"
>
...
...
template/m.yohobuy.com/partials/product/feedback-tab.phtml
View file @
db4e1d5
...
...
@@ -49,8 +49,8 @@
</div>
{{/ consults}}
</div>
<div class="consult-content-footer" id="consult-content-footer">
<a href="{{link}}">
<div class="consult-content-footer" data-href="{{link}}">
<a href="javascript:;">
查看更多
<span class="iconfont"></span></a>
</div>
...
...
@@ -58,8 +58,9 @@
<div class="consult-content-main content-main no-item">
<span class="iconfont"></span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="{{link}}">
<div class="consult-content-footer" data-href="{{link}}">
<a href="javascript:;">
我要咨询
<span class="iconfont"></span></a>
</div>
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
db4e1d5
...
...
@@ -32,36 +32,33 @@ class SearchController extends AbstractAction
*/
public
function
listAction
()
{
// // 过滤请求参数
// $condition = filter_input_array(INPUT_GET, array(
// 'query' => FILTER_DEFAULT,
// 'brand' => FILTER_DEFAULT,
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
//
// $query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// // unset($condition['discount']); 为了兼容js中传参的discount
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// if (isset($condition['query'])) {
// $condition['query'] = rawurlencode($condition['query']);
// }
$query
=
$this
->
get
(
'query'
,
''
);
$query
=
is_string
(
$query
)
?
''
:
strtolower
(
trim
(
$query
));
// 过滤请求参数
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'query'
=>
FILTER_DEFAULT
,
'brand'
=>
FILTER_DEFAULT
,
'sort'
=>
FILTER_DEFAULT
,
'msort'
=>
FILTER_DEFAULT
,
'misort'
=>
FILTER_DEFAULT
,
'color'
=>
FILTER_DEFAULT
,
'size'
=>
FILTER_DEFAULT
,
'style'
=>
FILTER_DEFAULT
,
'price'
=>
FILTER_DEFAULT
,
'discount'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,),
false
);
$query
=
empty
(
$condition
[
'query'
])
?
null
:
strtolower
(
trim
(
$condition
[
'query'
]));
if
(
isset
(
$condition
[
'discount'
]))
{
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
// unset($condition['discount']); 为了兼容js中传参的discount
}
// 为了兼容现在运营在用的p_d
if
(
isset
(
$condition
[
'p_d'
]))
{
$condition
[
'discount'
]
=
rawurldecode
(
$condition
[
'p_d'
]);
}
if
(
isset
(
$condition
[
'query'
]))
{
$condition
[
'query'
]
=
rawurlencode
(
$condition
[
'query'
]);
}
// 标识用户是否有输入搜索内容
$haveQuery
=
$query
!==
''
;
...
...
@@ -133,13 +130,13 @@ class SearchController extends AbstractAction
$classNames
=
array
();
}
// else {
// $condition['query'] = '';
// }
else
{
$condition
[
'query'
]
=
''
;
}
$data
=
array
();
$data
[
'goodListPage'
]
=
true
;
//
$data['goodList'] = $condition;
$data
[
'goodList'
]
=
$condition
;
$data
[
'query'
]
=
$query
;
// 搜索是一级品类
if
(
$isQueryFirstClass
)
{
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
db4e1d5
...
...
@@ -70,20 +70,21 @@ class OrderModel
if
(
!
empty
(
$data
[
'data'
][
'order_list'
]))
{
// 订单的状态列表
//$orderStatus = Helpers::getOrderStatus();
$count
=
0
;
foreach
(
$data
[
'data'
][
'order_list'
]
as
$key
=>
$vo
)
{
// if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) {
// $vo['status'] = 1;
// }
$count
=
0
;
//订单号,支付状态,订单商品数量,订单总价格
$result
[
$key
][
'orderNum'
]
=
$vo
[
'order_code'
];
//$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ];
$result
[
$key
][
'orderStatus'
]
=
$vo
[
'status_str'
];
$result
[
$key
][
'count'
]
=
count
(
$vo
[
'order_goods'
]);
$result
[
$key
][
'sumCost'
]
=
$vo
[
'amount'
];
//类内调用格式化订单商品数据方法
$result
[
$key
][
'goods'
]
=
Helpers
::
formatOrderGoods
(
$vo
[
'order_goods'
]);
$result
[
$key
][
'goods'
]
=
Helpers
::
formatOrderGoods
(
$vo
[
'order_goods'
]
,
$count
);
$result
[
$key
][
'detailUrl'
]
=
Helpers
::
url
(
'/home/orders/detail'
,
array
(
'order_code'
=>
$vo
[
'order_code'
],
't'
=>
time
()));
$result
[
$key
][
'count'
]
=
$count
;
//根据订单status判断订单处于什么状态。
do
{
//订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
db4e1d5
...
...
@@ -304,7 +304,7 @@ class DetailModel
/* 参考尺码 */
$boyReference
=
!
empty
(
$sizeInfo
[
'productExtra'
][
'boyReference'
]);
$girlReference
=
!
empty
(
$sizeInfo
[
'productExtra'
][
'girlReference'
]);
$gender
=
isset
(
$sizeInfo
[
'
gender'
])
?
$sizeInfo
[
'gender'
]
:
3
;
$gender
=
isset
(
$sizeInfo
[
'
productDescBo'
][
'gender'
])
?
$sizeInfo
[
'productDescBo'
]
[
'gender'
]
:
3
;
$referenceName
=
'参考尺码'
;
if
((
$gender
==
1
&&
$boyReference
)
||
(
$gender
==
2
&&
$girlReference
))
{
$referenceName
=
'参考尺码'
;
...
...
yohobuy/m.yohobuy.com/application/models/Product/Search.php
View file @
db4e1d5
...
...
@@ -87,17 +87,26 @@ class SearchModel
}
}
// 设置选定的gender
$gender
=
'1,2,3'
;
if
(
isset
(
$condition
[
'gender'
]))
{
$gender
=
$condition
[
'gender'
];
}
// 区别各种列表页面的筛选数据
if
(
isset
(
$condition
[
'brand'
]))
{
$listData
=
BrandData
::
filterBrandData
(
$condition
);
$exclude
=
'brand'
;
}
else
if
(
isset
(
$condition
[
'sort'
]))
{
$listData
=
ClassData
::
filterClassData
(
$condition
);
$exclude
=
'group_sort'
;
}
else
{
$listData
=
SearchData
::
searchByCondition
(
$condition
);
$exclude
=
null
;
}
if
(
isset
(
$listData
[
'data'
][
'filter'
]))
{
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$listData
[
'data'
][
'filter'
]);
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$listData
[
'data'
][
'filter'
]
,
$gender
,
$exclude
);
}
if
(
USE_CACHE
)
{
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
db4e1d5
...
...
@@ -23,66 +23,66 @@ class IndexController extends AbstractAction
*/
public
function
indexAction
()
{
// // 过滤请求参数
// $condition = filter_input_array(INPUT_GET, array(
// 'brand' => FILTER_DEFAULT,
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
//
// // 转义品牌
// if (isset($condition['brand'])) {
// $condition['brand'] = rawurldecode($condition['brand']);
// }
// // 转义分类
// if (isset($condition['sort'])) {
// $condition['sort'] = rawurldecode($condition['sort']);
// }
// // 转义一级分类
// if (isset($condition['msort'])) {
// $condition['msort'] = rawurldecode($condition['msort']);
// }
// // 转义二级分类
// if (isset($condition['misort'])) {
// $condition['misort'] = rawurldecode($condition['misort']);
// }
// // 转义颜色
// if (isset($condition['color'])) {
// $condition['color'] = rawurldecode($condition['color']);
// }
// // 转义尺码
// if (isset($condition['size'])) {
// $condition['size'] = rawurldecode($condition['size']);
// }
// // 转义风格
// if (isset($condition['style'])) {
// $condition['style'] = rawurldecode($condition['style']);
// }
// // 转义价格
// if (isset($condition['price'])) {
// $condition['price'] = rawurldecode($condition['price']);
// }
// // 转换折扣
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// // 性别参数,不传则从COOKIE获取
// if (!isset($condition['gender'])) {
// $condition['gender'] = Helpers::getGenderByCookie();
// } else {
// $condition['gender'] = rawurldecode($condition['gender']);
// }
// 过滤请求参数
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'brand'
=>
FILTER_DEFAULT
,
'sort'
=>
FILTER_DEFAULT
,
'msort'
=>
FILTER_DEFAULT
,
'misort'
=>
FILTER_DEFAULT
,
'color'
=>
FILTER_DEFAULT
,
'size'
=>
FILTER_DEFAULT
,
'style'
=>
FILTER_DEFAULT
,
'price'
=>
FILTER_DEFAULT
,
'discount'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,),
false
);
// 转义品牌
if
(
isset
(
$condition
[
'brand'
]))
{
$condition
[
'brand'
]
=
rawurldecode
(
$condition
[
'brand'
]);
}
// 转义分类
if
(
isset
(
$condition
[
'sort'
]))
{
$condition
[
'sort'
]
=
rawurldecode
(
$condition
[
'sort'
]);
}
// 转义一级分类
if
(
isset
(
$condition
[
'msort'
]))
{
$condition
[
'msort'
]
=
rawurldecode
(
$condition
[
'msort'
]);
}
// 转义二级分类
if
(
isset
(
$condition
[
'misort'
]))
{
$condition
[
'misort'
]
=
rawurldecode
(
$condition
[
'misort'
]);
}
// 转义颜色
if
(
isset
(
$condition
[
'color'
]))
{
$condition
[
'color'
]
=
rawurldecode
(
$condition
[
'color'
]);
}
// 转义尺码
if
(
isset
(
$condition
[
'size'
]))
{
$condition
[
'size'
]
=
rawurldecode
(
$condition
[
'size'
]);
}
// 转义风格
if
(
isset
(
$condition
[
'style'
]))
{
$condition
[
'style'
]
=
rawurldecode
(
$condition
[
'style'
]);
}
// 转义价格
if
(
isset
(
$condition
[
'price'
]))
{
$condition
[
'price'
]
=
rawurldecode
(
$condition
[
'price'
]);
}
// 转换折扣
if
(
isset
(
$condition
[
'discount'
]))
{
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
}
// 为了兼容现在运营在用的p_d
if
(
isset
(
$condition
[
'p_d'
]))
{
$condition
[
'discount'
]
=
rawurldecode
(
$condition
[
'p_d'
]);
}
// 性别参数,不传则从COOKIE获取
if
(
!
isset
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
Helpers
::
getGenderByCookie
();
}
else
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
// 品类名称参数, 不传则默认为全部
$name
=
$this
->
get
(
'sort_name'
);
...
...
@@ -92,11 +92,10 @@ class IndexController extends AbstractAction
$this
->
setTitle
(
$name
);
$this
->
setNavHeader
(
$name
,
true
,
SITE_MAIN
);
// if (!$condition) {
// $condition = array();
// }
// $goodList = $condition;
$goodList
=
array
();
if
(
!
$condition
)
{
$condition
=
array
();
}
$goodList
=
$condition
;
$goodList
[
'cartUrl'
]
=
Helpers
::
url
(
'/cart/index/index'
,
null
);
$this
->
_view
->
display
(
'index'
,
array
(
...
...
@@ -133,13 +132,6 @@ class IndexController extends AbstractAction
$brandId
=
$brandLogo
[
'id'
];
}
/* 通过品牌域名找到对应的品牌ID */
// $domainList = Product\ListModel::getAllBrandDomains();
// $brandIds = array_keys($domainList, $domain);
// $brandId = 0;
// if (isset($brandIds[0])) {
// $brandId = $brandIds[0];
// }
// 当前的登录用户UID
$uid
=
$this
->
getUid
();
...
...
@@ -147,64 +139,64 @@ class IndexController extends AbstractAction
$from
=
$this
->
get
(
'from'
);
$query
=
$this
->
get
(
'query'
);
// /* 过滤请求参数 */
// $condition = filter_input_array(INPUT_GET, array(
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
// $condition['brand'] = $brandId;
// // 转义分类
// if (isset($condition['sort'])) {
// $condition['sort'] = rawurldecode($condition['sort']);
// }
// // 转义一级分类
// if (isset($condition['msort'])) {
// $condition['msort'] = rawurldecode($condition['msort']);
// }
// // 转义二级分类
// if (isset($condition['misort'])) {
// $condition['misort'] = rawurldecode($condition['misort']);
// }
// // 转义颜色
// if (isset($condition['color'])) {
// $condition['color'] = rawurldecode($condition['color']);
// }
// // 转义尺码
// if (isset($condition['size'])) {
// $condition['size'] = rawurldecode($condition['size']);
// }
// // 转义风格
// if (isset($condition['style'])) {
// $condition['style'] = rawurldecode($condition['style']);
// }
// // 转义价格
// if (isset($condition['price'])) {
// $condition['price'] = rawurldecode($condition['price']);
// }
// // 转换折扣
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// if ($brandId === 0) {
// $condition['query'] = $domain;
// }
//
// if (isset($condition['gender'])) {
// $condition['gender'] = rawurldecode($condition['gender']);
// } else {
// $condition['gender'] = Helpers::getGenderByCookie();
// }
/* 过滤请求参数 */
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'sort'
=>
FILTER_DEFAULT
,
'msort'
=>
FILTER_DEFAULT
,
'misort'
=>
FILTER_DEFAULT
,
'color'
=>
FILTER_DEFAULT
,
'size'
=>
FILTER_DEFAULT
,
'style'
=>
FILTER_DEFAULT
,
'price'
=>
FILTER_DEFAULT
,
'discount'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,),
false
);
$condition
[
'brand'
]
=
$brandId
;
// 转义分类
if
(
isset
(
$condition
[
'sort'
]))
{
$condition
[
'sort'
]
=
rawurldecode
(
$condition
[
'sort'
]);
}
// 转义一级分类
if
(
isset
(
$condition
[
'msort'
]))
{
$condition
[
'msort'
]
=
rawurldecode
(
$condition
[
'msort'
]);
}
// 转义二级分类
if
(
isset
(
$condition
[
'misort'
]))
{
$condition
[
'misort'
]
=
rawurldecode
(
$condition
[
'misort'
]);
}
// 转义颜色
if
(
isset
(
$condition
[
'color'
]))
{
$condition
[
'color'
]
=
rawurldecode
(
$condition
[
'color'
]);
}
// 转义尺码
if
(
isset
(
$condition
[
'size'
]))
{
$condition
[
'size'
]
=
rawurldecode
(
$condition
[
'size'
]);
}
// 转义风格
if
(
isset
(
$condition
[
'style'
]))
{
$condition
[
'style'
]
=
rawurldecode
(
$condition
[
'style'
]);
}
// 转义价格
if
(
isset
(
$condition
[
'price'
]))
{
$condition
[
'price'
]
=
rawurldecode
(
$condition
[
'price'
]);
}
// 转换折扣
if
(
isset
(
$condition
[
'discount'
]))
{
$condition
[
'p_d'
]
=
rawurldecode
(
$condition
[
'discount'
]);
}
// 为了兼容现在运营在用的p_d
if
(
isset
(
$condition
[
'p_d'
]))
{
$condition
[
'discount'
]
=
rawurldecode
(
$condition
[
'p_d'
]);
}
if
(
$brandId
===
0
)
{
$condition
[
'query'
]
=
$domain
;
}
if
(
isset
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
else
{
$condition
[
'gender'
]
=
Helpers
::
getGenderByCookie
();
}
$data
=
array
();
$data
[
'goodListPage'
]
=
true
;
...
...
Please
register
or
login
to post a comment