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
Plain Diff
Browse Files
Authored by
lore-w
9 years ago
Commit
4cc6ce2eb275656747b7b88d5999bbb382c6f312
2 parents
b029130f
9d36a972
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
273 additions
and
79 deletions
library/LibModels/Web/Product/SearchData.php
library/Plugin/HelperSearch.php
web-static/js/header.js
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
yohobuy/www.yohobuy.com/application/models/Product/Search.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
library/LibModels/Web/Product/SearchData.php
View file @
4cc6ce2
...
...
@@ -18,12 +18,12 @@ class SearchData extends \LibModels\Wap\Product\SearchData
case
'release'
:
if
(
$type
==
'sort'
){
return
'http://100.98.132.63/yohosearch/sortgroup.json'
;
}
if
(
$type
==
'discount'
){
}
elseif
(
$type
==
'discount'
){
return
'http://100.98.132.63/yohosearch/discount.json'
;
}
if
(
$type
==
'recent'
){
}
elseif
(
$type
==
'recent'
){
return
'http://100.98.132.63/yohosearch/recent.json'
;
}
elseif
(
$type
==
'review'
){
}
return
'http://100.98.132.63/yohosearch/search.json'
;
case
'test'
:
...
...
@@ -33,11 +33,13 @@ class SearchData extends \LibModels\Wap\Product\SearchData
if
(
$type
==
'sort'
){
return
'http://101.200.31.165/yohosearch/sortgroup.json'
;
}
if
(
$type
==
'discount'
){
else
if
(
$type
==
'discount'
){
return
'http://101.200.31.165/yohosearch/discount.json'
;
}
if
(
$type
==
'recent'
){
else
if
(
$type
==
'recent'
){
return
'http://101.200.31.165/yohosearch/recent.json'
;
}
elseif
(
$type
==
'review'
){
return
'http://itemapi.yohobuy.com/item/item/recentreview'
;
}
return
'http://101.200.31.165/yohosearch/search.json'
;
}
...
...
@@ -125,4 +127,14 @@ class SearchData extends \LibModels\Wap\Product\SearchData
public
static
function
recentShelve
(){
return
Yohobuy
::
get
(
self
::
getUrl
(
'recent'
));
}
/**
* 获取最近浏览记录
* @param int $limit
* @return json
*/
public
static
function
getRecentReview
(
$limit
=
0
)
{
}
}
\ No newline at end of file
...
...
library/Plugin/HelperSearch.php
View file @
4cc6ce2
...
...
@@ -74,7 +74,7 @@ class HelperSearch
//分类
$result
[
'filters'
][
'sort'
]
=
array
();
//品牌
$result
[
'filters'
][
'brand'
]
=
self
::
brand
(
$filter
);
$result
[
'filters'
][
'brand'
]
=
self
::
brand
(
$filter
,
$options
);
//价格
$result
[
'filters'
][
'price'
]
=
self
::
price
(
$filter
);
//颜色
...
...
@@ -105,14 +105,13 @@ class HelperSearch
//分类
$result
[
'leftContent'
][][
'allSort'
]
=
isset
(
$filter
[
'group_sort'
])
?
self
::
groupSort
(
$filter
[
'group_sort'
],
$options
)
:
array
();
//一周新品上架
$result
[
'leftContent'
][][
'newSales'
]
=
self
::
recentShelve
(
$filter
[
'recent'
]
);
$result
[
'leftContent'
][][
'newSales'
]
=
isset
(
$filter
[
'recent'
])
?
self
::
recentShelve
(
$filter
[
'recent'
])
:
array
(
);
//全部折扣
$result
[
'leftContent'
][][
'allDiscount'
]
=
self
::
getDiscount
(
$filter
[
'discount'
]
);
$result
[
'leftContent'
][][
'allDiscount'
]
=
isset
(
$filter
[
'discount'
])
?
self
::
getDiscount
(
$filter
[
'discount'
])
:
array
(
);
//总记录数
$result
[
'totalCount'
]
=
$data
[
'data'
][
'total'
];
//分页
$result
[
'pager'
]
=
self
::
pager
(
$result
[
'totalCount'
],
$options
[
'viewNum'
]);
//echo $result['pager']; exit;
//选中条件
$result
[
'filters'
][
'checkedConditions'
][
'conditions'
]
=
self
::
getSelected
();
$result
[
'pathNav'
]
=
self
::
$listnav
;
...
...
@@ -247,11 +246,11 @@ class HelperSearch
/**
* 组织搜索列表页面的左侧分类
* @param array $sort
* @param array $
params
* @param array $
option
* @return array
*/
public
static
function
groupSort
(
$sort
,
$option
=
array
())
{
self
::
setListNav
();
self
::
setListNav
(
$option
);
$params
=
self
::
$params
;
$gender
=
isset
(
$params
[
'gender'
])
?
$params
[
'gender'
]
:
''
;
...
...
@@ -291,7 +290,8 @@ class HelperSearch
);
foreach
(
$sort
as
$val
)
{
if
(
isset
(
$params
[
'msort'
])
&&
$params
[
'msort'
]
==
$val
[
'sort_id'
])
{
self
::
$listnav
[
1
]
=
array
(
$nav_index
=
isset
(
$option
[
'brandName'
])
&&
$option
[
'brandName'
]
?
2
:
1
;
self
::
$listnav
[
$nav_index
]
=
array
(
'sort_id'
=>
$val
[
'sort_id'
],
'name'
=>
$val
[
'sort_name'
],
'href'
=>
self
::
buildurl
(
array
(
...
...
@@ -325,7 +325,8 @@ class HelperSearch
);
foreach
(
$val
[
'sub'
]
as
$mval
)
{
if
(
isset
(
$params
[
'misort'
])
&&
$params
[
'misort'
]
==
$mval
[
'sort_id'
])
{
self
::
$listnav
[
2
]
=
array
(
$nav_index
=
isset
(
$option
[
'brandName'
])
&&
$option
[
'brandName'
]
?
3
:
2
;
self
::
$listnav
[
$nav_index
]
=
array
(
'sort_id'
=>
$mval
[
'sort_id'
],
'name'
=>
$mval
[
'sort_name'
],
'href'
=>
''
...
...
@@ -352,7 +353,7 @@ class HelperSearch
/**
* 品牌,可以多选
* @param array $
brand
* @param array $
filter
* @param array $options
* @return array
*/
...
...
@@ -481,7 +482,7 @@ class HelperSearch
/**
* 尺码的链接,不能多选
* @param array $
size
* @param array $
filter
* @return array
*/
public
static
function
size
(
$filter
)
{
...
...
@@ -525,7 +526,7 @@ class HelperSearch
/**
* 颜色,不能多选
* @param array $
colo
r
* @param array $
filte
r
* @return array
*/
public
static
function
color
(
$filter
)
{
...
...
@@ -580,7 +581,7 @@ class HelperSearch
/**
* 获取价格,不能多选
* @param array
$
price
* @param array
$
filter
* @return array
*/
public static function price(
$filter
) {
...
...
@@ -638,7 +639,7 @@ class HelperSearch
/**
* 风格,可以多选
* @param array
$
style
* @param array
$
filter
* @return array
*/
public static function style(
$filter
) {
...
...
web-static/js/header.js
View file @
4cc6ce2
...
...
@@ -9,7 +9,9 @@ var $ = require('yoho.jquery');
var
handlebars
=
require
(
'yoho.handlebars'
);
var
json2
=
require
(
'json2'
);
var
noticeSuccess
=
false
;
var
apiDomain
=
'http://api.open.yohobuy.com'
;
var
vipInfoCombine
=
null
;
var
loginInfoCombine
=
null
;
/**
* 判断为1的helper
* @param {[type]} v1 [description]
...
...
@@ -24,6 +26,37 @@ handlebars.registerHelper('equalone', function(v1, options) {
return
options
.
inverse
(
this
);
}
});
/**
* 判断等级为3的helper
* @param {[type]} v1 [description]
* @param {[type]} options) { if (v1 [description]
* @return {[type]} [description]
*/
handlebars
.
registerHelper
(
'equallevelthree'
,
function
(
v1
,
options
)
{
if
(
v1
===
'3'
)
{
return
options
.
fn
(
this
);
}
else
{
return
options
.
inverse
(
this
);
}
});
/**
* 判断为0的helper
* @param {[type]} v1 [description]
* @param {[type]} options) { if (v1 [description]
* @return {[type]} [description]
*/
handlebars
.
registerHelper
(
'equalzero'
,
function
(
v1
,
options
)
{
if
(
v1
===
'0'
)
{
return
options
.
fn
(
this
);
}
else
{
return
options
.
inverse
(
this
);
}
});
require
(
'../plugin/yohocookie'
);
require
(
'../plugin/yohocart'
);
/**
...
...
@@ -817,6 +850,7 @@ function actionExeTemplate() {
var
resulthtml
=
$
(
'#goodcartempwarpper'
).
html
().
replace
(
/
\\
/g
,
''
);
$
(
'#goodcartempwarpper'
).
html
(
resulthtml
);
vipInfoCombine
=
handlebars
.
compile
(
$
(
'#tmpl-my-login-new'
).
html
())
}
/**
* 执行搜索
...
...
@@ -828,6 +862,138 @@ function actionSearch() {
$
(
'#query_key'
).
search
(
searchDomain
);
}
/**
* 获取登录状态
* @return {[type]} [description]
*/
function
actionLoginState
(
_data
)
{
var
timestamp
=
new
Date
().
getTime
();
var
noLoginHtml
=
'<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">请登录</a>] [<a href="http://www.yohobuy.com/reg.html" class="list-a login-out" onclick="">免费注册</a>]'
var
loginHtml
=
'<span>Hi~<a href="http://www.yohobuy.com/home?t='
+
timestamp
+
'">{{user_name}}</a></span> '
+
'{{#equalone is_login}}'
+
'[<a href="{{logout}}" class="list-a login-out">退出</a>]'
+
'{{else}}'
+
'[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out">请登录</a>] '
+
'[<a href="http://www.yohobuy.com/reg.html" onclick="" class="list-a login-out">免费注册</a>]'
+
'{{/equalone}}'
;
var
boxObj
=
$
(
'#loginBox'
);
var
info
=
$
.
cookie
(
'_UID'
);
loginInfoCombine
=
handlebars
.
compile
(
loginHtml
);
if
(
typeof
info
==
'undefined'
||
info
==
null
)
{
boxObj
.
html
(
noLoginHtml
);
return
false
;
}
var
user
=
info
.
split
(
'::'
);
if
(
typeof
user
==
'undefined'
||
user
.
length
<
4
)
{
boxObj
.
html
(
noLoginHtml
);
return
false
;
}
var
userName
=
user
[
0
]
||
' '
;
var
name
=
''
;
var
_length
=
0
;
for
(
var
t
=
0
;
t
<
userName
.
length
;
t
++
)
{
var
char
=
userName
.
substr
(
t
,
1
);
if
(
/.*
[\u
4e00-
\u
9fa5
]
+.*$/
.
test
(
char
))
{
_length
+=
2
;
}
else
{
_length
+=
1
;
}
}
if
(
_length
<=
10
)
{
name
=
userName
;
}
else
{
_num
=
0
;
for
(
var
t
=
0
;
t
<
userName
.
length
;
t
++
)
{
if
(
_num
<
10
)
{
var
char
=
userName
.
substr
(
t
,
1
);
if
(
char
!=
'*'
)
{
if
(
/.*
[\u
4e00-
\u
9fa5
]
+.*$/
.
test
(
char
))
{
_num
+=
2
;
}
else
{
_num
+=
1
;
}
}
name
+=
char
;
}
}
if
(
name
.
length
<
userName
.
length
)
{
name
+=
'...'
;
}
}
var
_logout
=
''
;
if
(
/http:
\/\/
/
.
test
(
user
[
3
]))
{
_logout
=
user
[
3
].
replace
(
'www.yohobuy.com'
,
'www.yohobuy.com'
);
}
else
{
_logout
=
'http://www.yohobuy.com/logout_'
+
user
[
3
]
+
'.html'
;
}
var
data
=
{
"user_name"
:
name
,
"logout"
:
_logout
,
"random"
:
Math
.
random
()
};
var
is_login
=
'1'
;
if
(
_data
.
result
===
-
1
)
{
is_login
=
'-1'
;
}
data
[
'is_login'
]
=
is_login
;
boxObj
.
html
(
loginInfoCombine
(
data
));
}
/**
* 获得vip用户信息
* @return {[type]} [description]
*/
function
actionVipInfo
(
_data
)
{
if
(
_data
.
result
==
1
)
{
var
vipInfo
=
_data
.
data
;
if
(
typeof
vipInfo
==
undefined
||
vipInfo
.
length
<
1
)
{
return
false
;
}
$
(
'#myYohoBox'
).
mouseenter
(
function
()
{
$
(
this
).
addClass
(
'acttags'
);
$
(
'#myYohoBox .myyoho-info'
).
show
().
html
(
vipInfoCombine
(
vipInfo
));
var
headUrl
=
$
(
'.myyoho-photo img'
).
attr
(
'data-url'
);
if
(
$
.
_checkUrlState
==
1
)
{
$
(
'.myyoho-photo'
).
show
().
find
(
'img'
).
attr
(
'src'
,
headUrl
);
return
;
}
if
(
headUrl
==
''
||
$
.
_checkUrl
!=
''
)
{
return
;
}
$
.
ajax
({
url
:
headUrl
,
type
:
'GET'
,
complete
:
function
(
response
)
{
if
(
response
.
status
==
200
||
response
.
status
==
0
)
{
$
(
'.myyoho-photo'
).
show
().
find
(
'img'
).
attr
(
'src'
,
headUrl
);
$
.
_checkUrlState
=
1
;
}
$
.
_checkUrl
=
headUrl
;
}
});
;
});
$
(
'#myYohoBox'
).
mouseleave
(
function
()
{
$
(
this
).
removeClass
(
'acttags'
);
$
(
'#myYohoBox .myyoho-info'
).
hide
()
});
}
else
{}
}
/**
* 获取登录信息
* @return {[type]} [description]
*/
function
actionLoginInfo
()
{
var
param
=
{
method
:
'open.passport.get'
};
$
.
getData
(
apiDomain
,
param
,
function
(
_data
)
{
actionLoginState
(
_data
);
// 更改登录状态
actionVipInfo
(
_data
);
//获得vip;
});
}
/**
* 初始化函数
* @return {[type]} [description]
*/
...
...
@@ -849,6 +1015,7 @@ function init() {
actionClickMiniCartBox
();
//点击购物车跳转
actionListenDelCarGoods
();
//监听购物车删除
actionListenCartMore
();
//
actionLoginInfo
();
//获取登录信息
}
init
();
\ No newline at end of file
...
...
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
View file @
4cc6ce2
<?php
namespace
Product
;
use
Plugin\Helpers
;
use
Plugin\HelperSearch
;
use
LibModels\Web\Product\BrandData
;
use
LibModels\Wap\Product\SearchData
;
use
LibModels\Web\Product\SearchData
as
WebProduct
;
...
...
@@ -11,54 +13,65 @@ use LibModels\Web\Product\SearchData as WebProduct;
*
* @author Administrator
*/
class
BrandsModel
{
class
BrandsModel
{
const
URL_BRAND_INDEX
=
'/product/index/brand'
;
public
static
$shopName
;
public
static
$home
;
/**
/**
* 搜索品牌数据
*
* @param $condition array
*
搜索数据的条件
* 搜索数据的条件
* @param $options array
* @return array
*/
public
static
function
getBrandSearchData
(
$condition
,
$options
,
$domain
,
$uid
,
$brandId
)
{
public
static
function
getBrandSearchData
(
$condition
,
$options
,
$domain
,
$uid
,
$brandId
)
{
// 调用商品搜索接口
$data
=
SearchData
::
searchElasticByCondition
(
$condition
);
//导航名
//获取品牌banner数据
$banner
=
self
::
getBannerByDomain
(
$domain
,
$brandId
,
$uid
=
''
);
$brandName
=
self
::
$shopName
;
$option
[
'brandName'
]
=
$brandName
;
//配置调用分类接口参数
$param
=
array
();
$param
[
'brand'
]
=
$condition
[
'brand'
];
//获取分类列表数据
$classes
=
WebProduct
::
getClassesData
(
$param
);
$options
[
'brandName'
]
=
$brandName
;
if
(
isset
(
$data
[
'code'
])
&&
$data
[
'code'
]
===
200
)
{
//获取分类列表数据
$param
=
array
();
$param
[
'brand'
]
=
$condition
[
'brand'
];
$classes
=
WebProduct
::
getClassesData
(
$param
);
if
(
isset
(
$classes
[
'code'
])
&&
$classes
[
'code'
]
===
200
)
{
$data
[
'data'
][
'filter'
][
'group_sort'
]
=
$classes
[
'data'
][
'sort'
];
}
//用户浏览记录
// 组织模板数据
$list
=
HelperSearch
::
getList
(
$data
,
$options
);
//合并商品搜索数据与品牌banner数据
$list
=
array_merge_recursive
(
$list
,
$banner
);
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
'list'
=>
$list
);
}
else
{
$data
=
array
();
}
//获取品牌系列数据
$adNav
=
self
::
getAdNav
(
$condition
[
'brand'
]);
//获取品牌数据
$banner
=
self
::
getBannerByDomain
(
$domain
,
$brandId
,
$uid
=
''
);
//开始组装数据
$data
[
'list'
][
'leftContent'
][]
=
array
(
'picLink'
=>
$adNav
);
return
$data
;
}
/**
* 获取品牌首页banner条
* @string $domain 品牌域名
...
...
@@ -67,8 +80,7 @@ class BrandsModel
*
* @return array 品牌banner条数据
*/
public
static
function
getBannerByDomain
(
$domain
,
$brandId
,
$uid
=
''
)
{
public
static
function
getBannerByDomain
(
$domain
,
$brandId
,
$uid
=
''
)
{
// 构造品牌主页url
self
::
$home
=
Helpers
::
url
(
''
,
''
,
$domain
)
.
self
::
URL_BRAND_INDEX
;
// 根据品牌Id获取品牌banner图
...
...
@@ -83,9 +95,9 @@ class BrandsModel
$is_favorite
=
false
;
$logo
=
false
;
$shopName
=
false
;
do
{
if
(
!
isset
(
$intro
[
'data'
]))
{
if
(
!
isset
(
$intro
[
'data'
]))
{
break
;
}
// 获取是否收藏
...
...
@@ -99,10 +111,9 @@ class BrandsModel
// 获取品牌名
self
::
$shopName
=
$intro
[
'data'
][
'brand_name'
];
}
while
(
false
);
// 返回banner数据
return
array
(
'list'
=>
array
(
'brandBanner'
=>
array
(
'bannerHeight'
=>
'150'
,
'coled'
=>
$is_favorite
,
...
...
@@ -123,26 +134,21 @@ class BrandsModel
)
)
)
)
);
);
}
//获取品牌系列数据
public
static
function
getAdNav
(
$brandId
,
$status
=
1
)
{
//$condition['brand']
public
static
function
getAdNav
(
$brandId
,
$status
=
1
)
{
//调用接口获得数据
$advNav
=
BrandData
::
getFolderByBrand
(
$brandId
,
$status
);
$advNav
=
BrandData
::
getFolderByBrand
(
$brandId
,
$status
);
$result
=
array
();
if
(
isset
(
$advNav
[
'data'
])
&&
$advNav
[
'code'
]
===
200
)
{
foreach
(
$advNav
[
'data'
]
as
$key
=>
$value
)
{
$result
[
'list'
][
$key
][
'href'
]
=
self
::
$home
.
'?folder='
.
$value
[
'id'
];
$result
[
'list'
][
$key
][
'href'
]
=
self
::
$home
.
'?folder
_id
='
.
$value
[
'id'
];
$result
[
'list'
][
$key
][
'src'
]
=
$value
[
'brand_sort_ico'
];
}
}
return
$result
;
//$data['list']['advNav'] = $result;
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
4cc6ce2
<?php
namespace
Product
;
use
Configs\CacheConfig
;
use
Plugin\HelperSearchNew
;
use
Plugin\Images
;
use
Plugin\Cache
;
use
Plugin\HelperSearch
;
use
\LibModels\Web\Product\SearchData
;
...
...
@@ -23,7 +19,7 @@ class SearchModel
/**
* 根据条件获取搜索数据
*
* @param $condition 搜索数据的条件
* @param $condition 搜索数据的条件
* @param $options Array([imgSize]
* => Array([0] => 235[1] => 314)[minImgSize] => Array([0] => 60[1] => 80)[gender] => 1[needPd] => Y[rowNum] => 5[viewNum] => 60)
* @author sefon 2015-12-17 16:12:18
...
...
@@ -32,7 +28,6 @@ class SearchModel
public
static
function
getSearchData
(
$condition
,
$options
)
{
$data
=
array
();
// 调用接口查询商品数据
$result
=
SearchData
::
searchElasticByCondition
(
$condition
);
if
(
isset
(
$result
[
'code'
])
&&
$result
[
'code'
]
===
200
)
{
...
...
@@ -51,6 +46,8 @@ class SearchModel
if
(
isset
(
$discount
[
'code'
])
&&
$discount
[
'code'
]
===
200
)
{
$result
[
'data'
][
'filter'
][
'recent'
]
=
$recent
[
'data'
][
'recent'
];
}
//用户浏览记录
$result
[
'data'
][
'filter'
][
'review'
]
=
SearchData
::
getRecentReview
();
// 组织模板数据
$list
=
HelperSearch
::
getList
(
$result
,
$options
);
$data
=
array
(
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
4cc6ce2
...
...
@@ -60,11 +60,11 @@ class IndexController extends WebAction
//每页显示商品数
if
(
!
isset
(
$condition
[
'viewNum'
])
||
empty
(
$condition
[
'viewNum'
])){
$condition
[
'viewNum'
]
=
60
;
$condition
[
'viewNum'
]
=
59
;
}
$view_num_arr
=
array
(
60
,
100
,
200
);
if
(
!
in_array
(
$condition
[
'viewNum'
],
$view_num_arr
))
{
$condition
[
'viewNum'
]
=
60
;
$condition
[
'viewNum'
]
=
59
;
}
//每行显示的商品数量
if
(
!
isset
(
$condition
[
'rowNum'
])
||
empty
(
$condition
[
'rowNum'
])){
...
...
@@ -87,7 +87,7 @@ class IndexController extends WebAction
'gender'
=>
$gender
,
'needPd'
=>
'Y'
,
'rowNum'
=>
$condition
[
'rowNum'
],
'viewNum'
=>
$condition
[
'viewNum'
],
'viewNum'
=>
$condition
[
'viewNum'
]
-
1
,
);
$params
=
$condition
+
$_GET
;
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
4cc6ce2
...
...
@@ -5,13 +5,13 @@ class ListController extends WebAction
{
public
function
indexAction
()
{
}
public
function
newAction
(){
}
/**
* list列表sale
*/
...
...
@@ -48,11 +48,11 @@ class ListController extends WebAction
$condition
[
'gender'
]
=
$gender
;
//每页显示商品数
if
(
!
isset
(
$condition
[
'viewNum'
])
||
empty
(
$condition
[
'viewNum'
])){
$condition
[
'viewNum'
]
=
60
;
$condition
[
'viewNum'
]
=
59
;
}
$view_num_arr
=
array
(
60
,
100
,
200
);
if
(
!
in_array
(
$condition
[
'viewNum'
],
$view_num_arr
))
{
$condition
[
'viewNum'
]
=
60
;
$condition
[
'viewNum'
]
=
59
;
}
//每行显示的商品数量
if
(
!
isset
(
$condition
[
'rowNum'
])
||
empty
(
$condition
[
'rowNum'
])){
...
...
@@ -70,14 +70,25 @@ class ListController extends WebAction
//$query = $this->get('query');
//返回搜索条件
$condition
[
'needFilter'
]
=
1
;
//过滤赠品
$condition
[
'attribute_not'
]
=
2
;
/*sale*/
//默认排序
if
(
!
isset
(
$condition
[
'order'
])
||
empty
(
$condition
[
'order'
]))
{
$condition
[
'order'
]
=
's_n_desc'
;
}
if
(
!
isset
(
$condition
[
'p_d'
])
||
empty
(
$condition
[
'p_d'
]))
{
$condition
[
'p_d'
]
=
'0,0.9'
;
}
$options
=
array
(
'imgSize'
=>
$imgSize
,
'minImgSize'
=>
$minImgSize
,
'gender'
=>
$gender
,
'needPd'
=>
'Y'
,
'rowNum'
=>
$condition
[
'rowNum'
],
'viewNum'
=>
$condition
[
'viewNum'
],
'viewNum'
=>
$condition
[
'viewNum'
]
-
1
,
);
$params
=
$condition
+
$_GET
;
$params
=
array_filter
(
$params
);
$data
=
SearchModel
::
getSearchData
(
$params
,
$options
);
...
...
Please
register
or
login
to post a comment