Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
runner
9 years ago
Commit
8c766269e1ccf12467cbede726e7364056e592f9
1 parent
a8166cef
filter age update
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
8 deletions
library/LibModels/Wap/Product/NewsaleData.php
static/js/product/list.js
static/js/product/newsale/discount.js
static/js/product/newsale/newarrival.js
template/m.yohobuy.com/partials/product/query-param.phtml
yohobuy/m.yohobuy.com/application/controllers/Search.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
library/LibModels/Wap/Product/NewsaleData.php
View file @
8c76626
...
...
@@ -78,10 +78,11 @@ class NewsaleData
*
* @return array 根据指定条件筛选出来的商品
*/
public
static
function
selectNewSaleProducts
(
$gender
,
$brand
,
$sort
,
$color
,
$size
,
$price
,
$p_d
,
$channel
,
$dayLimit
=
null
,
$limit
=
60
,
$page
=
1
,
$order
=
's_t_desc'
,
$shop
)
public
static
function
selectNewSaleProducts
(
$gender
,
$
age_level
,
$
brand
,
$sort
,
$color
,
$size
,
$price
,
$p_d
,
$channel
,
$dayLimit
=
null
,
$limit
=
60
,
$page
=
1
,
$order
=
's_t_desc'
,
$shop
)
{
$selectItems
=
array
(
'gender'
=>
$gender
,
'age_level'
=>
$age_level
,
'brand'
=>
$brand
,
'shop_id'
=>
$shop
,
'sort'
=>
$sort
,
...
...
@@ -92,13 +93,20 @@ class NewsaleData
'dayLimit'
=>
$dayLimit
);
// 拉取筛选参数
$queriedParams
=
array_filter
(
$selectItems
,
function
(
$v
)
{
return
!
empty
(
$v
);
});
if
(
isset
(
$selectItems
[
'age_level'
])
&&
$selectItems
[
'age_level'
]
===
'0'
){
$queriedParams
=
array_filter
(
$selectItems
,
function
(
$v
)
{
return
!
empty
(
$v
);
});
$queriedParams
[
'age_level'
]
=
'0'
;
}
else
{
$queriedParams
=
array_filter
(
$selectItems
,
function
(
$v
)
{
return
!
empty
(
$v
);
});
}
$param
=
Yohobuy
::
param
();
if
(
!
is_null
(
$dayLimit
))
{
$param
[
'method'
]
=
'app.search.
newProduct
'
;
$param
[
'method'
]
=
'app.search.
sales
'
;
}
else
{
$param
[
'method'
]
=
'app.search.sales'
;
$param
[
'p_d'
]
=
'0.1,0.9'
;
...
...
static/js/product/list.js
View file @
8c76626
...
...
@@ -211,6 +211,11 @@ function search(opt) {
color
:
opt
.
id
};
break
;
case
'ageLevel'
:
ext
=
{
age_level
:
opt
.
id
};
break
;
case
'size'
:
ext
=
{
size
:
opt
.
id
...
...
static/js/product/newsale/discount.js
View file @
8c76626
...
...
@@ -109,6 +109,11 @@ function search(opt) {
brand
:
opt
.
id
};
break
;
case
'ageLevel'
:
ext
=
{
age_level
:
opt
.
id
};
break
;
case
'sort'
:
ext
=
{
sort
:
opt
.
id
...
...
static/js/product/newsale/newarrival.js
View file @
8c76626
...
...
@@ -128,6 +128,11 @@ function search(opt) {
color
:
opt
.
id
};
break
;
case
'ageLevel'
:
ext
=
{
age_level
:
opt
.
id
};
break
;
case
'size'
:
ext
=
{
size
:
opt
.
id
...
...
template/m.yohobuy.com/partials/product/query-param.phtml
View file @
8c76626
...
...
@@ -58,6 +58,10 @@
<input
class=
"query-param"
type=
"hidden"
data-attr=
"p_d"
value=
"{{p_d}}"
>
{
{/if
}
}
{
{#if
age_level
}
}
<input
class=
"query-param"
type=
"hidden"
data-attr=
"age_level"
value=
"{{age_level}}"
>
{
{/if
}
}
{
{#if
channel
}
}
<input
class=
"query-param"
type=
"hidden"
data-attr=
"channel"
value=
"{{channel}}"
>
{
{/if
}
}
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
8c76626
...
...
@@ -250,6 +250,7 @@ class SearchController extends AbstractAction
'channel'
=>
FILTER_DEFAULT
,
'p_d'
=>
FILTER_DEFAULT
,
'outlets'
=>
FILTER_DEFAULT
,
'age_level'
=>
FILTER_DEFAULT
,
'page'
=>
FILTER_VALIDATE_INT
,),
false
);
if
(
!
empty
(
$condition
[
'shop_id'
]))
{
...
...
@@ -298,6 +299,10 @@ class SearchController extends AbstractAction
if
(
isset
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
// 转义性别
if
(
isset
(
$condition
[
'age_level'
]))
{
$condition
[
'age_level'
]
=
rawurldecode
(
$condition
[
'age_level'
]);
}
if
(
isset
(
$condition
[
'query'
]))
{
$condition
[
'query'
]
=
rawurldecode
(
$condition
[
'query'
]);
}
...
...
@@ -321,7 +326,12 @@ class SearchController extends AbstractAction
$tagSale
=
$this
->
get
(
'tagSale'
,
0
);
$tagSale
=
$tagSale
===
0
?
true
:
false
;
// 过滤掉值为空的条件
$condition
=
array_filter
(
$condition
);
if
(
isset
(
$condition
[
'age_level'
])
&&
$condition
[
'age_level'
]
===
'0'
){
//年龄删选的成人id为0
$condition
=
array_filter
(
$condition
);
$condition
[
'age_level'
]
=
'0'
;
}
else
{
$condition
=
array_filter
(
$condition
);
}
// /* 模糊搜索关键词 */
// if (isset($condition['query'])) {
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
8c76626
...
...
@@ -133,6 +133,7 @@ class NewsaleController extends AbstractAction
if
(
$this
->
isAjax
())
{
$gender
=
$this
->
get
(
'gender'
)
?
$this
->
get
(
'gender'
)
:
Helpers
::
getGenderByCookie
();
$age_level
=
$this
->
get
(
'age_level'
,
null
);
$brand
=
$this
->
get
(
'brand'
,
null
);
$sort
=
$this
->
get
(
'sort'
,
null
);
$color
=
$this
->
get
(
'color'
,
null
);
...
...
@@ -166,7 +167,7 @@ class NewsaleController extends AbstractAction
}
$data
=
NewsaleData
::
selectNewSaleProducts
(
$gender
,
$brand
,
$sort
,
$color
,
$size
,
$price
,
$p_d
,
$channel
,
$dayLimit
,
$limit
,
$page
,
$order
,
null
$gender
,
'0'
,
$brand
,
$sort
,
$color
,
$size
,
$price
,
$p_d
,
$channel
,
$dayLimit
,
$limit
,
$page
,
$order
,
null
);
$result
=
\Product\NewsaleModel
::
selectData
(
$data
);
}
...
...
@@ -188,6 +189,7 @@ class NewsaleController extends AbstractAction
if
(
$this
->
isAjax
())
{
$gender
=
$this
->
get
(
'gender'
)
?
$this
->
get
(
'gender'
)
:
Helpers
::
getGenderByCookie
();
$age_level
=
$this
->
get
(
'$age_level'
,
null
);
$brand
=
$this
->
get
(
'brand'
,
null
);
$shop
=
$this
->
get
(
'shop_id'
,
null
);
$sort
=
$this
->
get
(
'sort'
,
null
);
...
...
@@ -206,7 +208,7 @@ class NewsaleController extends AbstractAction
$channel
=
$this
->
get
(
'channel'
)
?
$this
->
get
(
'channel'
)
:
Helpers
::
getChannelByCookie
();
$data
=
NewsaleData
::
selectNewSaleProducts
(
$gender
,
$brand
,
$sort
,
$color
,
$size
,
$price
,
$p_d
,
$channel
,
$dayLimit
,
$limit
,
$page
,
$order
,
$shop
$gender
,
$
age_level
,
$
brand
,
$sort
,
$color
,
$size
,
$price
,
$p_d
,
$channel
,
$dayLimit
,
$limit
,
$page
,
$order
,
$shop
);
$result
=
\Product\NewsaleModel
::
filterData
(
$data
,
$gender
);
}
...
...
Please
register
or
login
to post a comment