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
Email Patches
Plain Diff
Browse Files
Authored by
hf
10 years ago
Commit
3a6072d11ef13c63a236a3930519a2a6fa5f44ab
1 parent
e4846db2
fixes bug to search list page show brand
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
18 deletions
library/LibModels/Wap/Category/BrandData.php
library/LibModels/Wap/Category/ClassData.php
yohobuy/m.yohobuy.com/application/controllers/Search.php
library/LibModels/Wap/Category/BrandData.php
View file @
3a6072d
...
...
@@ -16,6 +16,7 @@ use Api\Sign;
*/
class
BrandData
{
const
URI_BRAND_TOPPOS
=
'operations/api/v5/resource/get'
;
/**
...
...
@@ -32,13 +33,13 @@ class BrandData
public
static
function
package
(
$contentCode
,
$channel
)
{
$urlList
=
array
();
/* 顶部的轮翻广告及热门品牌数据 */
$param
=
Yohobuy
::
param
();
$param
[
'content_code'
]
=
$contentCode
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
$urlList
[
'brandTop'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_BRAND_TOPPOS
,
$param
);
/* 按字母"A-Z"分组的品牌列表数据 */
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.brand.brandlist'
;
...
...
@@ -48,7 +49,7 @@ class BrandData
return
Yohobuy
::
getMulti
(
$urlList
);
}
/**
* 获取品牌数据
*
...
...
@@ -98,7 +99,7 @@ class BrandData
$param
[
'uid'
]
=
$uid
;
$param
[
'method'
]
=
'app.brand.getBrandIntro'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
$cache
=
empty
(
$uid
)
?
3600
:
false
;
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
,
$cache
);
// 有缓存1小时
...
...
@@ -165,8 +166,8 @@ class BrandData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
/**
* 查询商品数据
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
...
...
@@ -182,15 +183,21 @@ class BrandData
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public
static
function
filterBrandData
(
$condition
,
$order
=
's_t_desc'
,
$limit
=
60
,
$page
=
1
)
public
static
function
filterBrandData
(
$condition
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.search.brand'
;
$param
[
'page'
]
=
$page
;
$param
[
'limit'
]
=
$limit
;
$param
[
'order'
]
=
$order
;
$param
+=
$condition
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
if
(
!
isset
(
$param
[
'order'
]))
{
$param
[
'order'
]
=
's_t_desc'
;
}
if
(
!
isset
(
$param
[
'limit'
]))
{
$param
[
'limit'
]
=
60
;
}
if
(
!
isset
(
$param
[
'page'
]))
{
$param
[
'page'
]
=
1
;
}
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
...
...
library/LibModels/Wap/Category/ClassData.php
View file @
3a6072d
...
...
@@ -92,15 +92,21 @@ class ClassData
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public
static
function
filterClassData
(
$condition
,
$order
=
's_t_desc'
,
$limit
=
60
,
$page
=
1
)
public
static
function
filterClassData
(
$condition
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.search.category'
;
$param
[
'page'
]
=
$page
;
$param
[
'limit'
]
=
$limit
;
$param
[
'order'
]
=
$order
;
$param
+=
$condition
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
if
(
!
isset
(
$param
[
'order'
]))
{
$param
[
'order'
]
=
's_t_desc'
;
}
if
(
!
isset
(
$param
[
'limit'
]))
{
$param
[
'limit'
]
=
60
;
}
if
(
!
isset
(
$param
[
'page'
]))
{
$param
[
'page'
]
=
1
;
}
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
3a6072d
...
...
@@ -171,6 +171,7 @@ class SearchController extends AbstractAction
$data
[
'goodListPage'
]
=
true
;
$data
[
'goodList'
]
=
$condition
;
$data
[
'query'
]
=
$query
;
// 查询数据
if
(
!
isset
(
$condition
[
'query'
]))
{
...
...
@@ -233,9 +234,19 @@ class SearchController extends AbstractAction
}
$data
=
array
();
// 查询品类数据
// 查询品类
或品牌
数据
if
(
!
isset
(
$condition
[
'query'
]))
{
$data
+=
Product\ListModel
::
getClassData
(
$condition
,
$order
,
$page
);
$condition
[
'order'
]
=
$order
;
$condition
[
'page'
]
=
$page
;
// 搜索品类
if
(
!
isset
(
$condition
[
'brand'
]))
{
$data
+=
Product\ListModel
::
getClassData
(
$condition
);
}
// 搜索品牌
else
{
$title
=
''
;
$data
+=
Product\ListModel
::
getBrandData
(
$condition
,
$title
);
}
if
(
isset
(
$data
[
'filter'
]))
{
unset
(
$data
[
'filter'
]);
}
...
...
Please
register
or
login
to post a comment