Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
HF
9 years ago
Commit
3c2e1cd06739c4ec4b63b684b908c4284deaf6db
1 parent
2a4f4e6e
do modify product detail page call comments list api to old
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
library/LibModels/Wap/Product/DetailData.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
library/LibModels/Wap/Product/DetailData.php
View file @
3c2e1cd
...
...
@@ -67,12 +67,13 @@ class DetailData
public
static
function
consultList
(
$productId
,
$pageNum
,
$pageSize
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'
h5.consul
t.li'
;
$param
[
'method'
]
=
'
app.commen
t.li'
;
$param
[
'product_id'
]
=
$productId
;
$param
[
'page'
]
=
$pageNum
;
$param
[
'limit'
]
=
$pageSize
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
3c2e1cd
...
...
@@ -449,6 +449,11 @@ class DetailModel
/**
* 获取评价列表
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public
static
function
getComments
(
$productId
,
$pageNum
=
1
,
$pageSize
=
300
)
{
...
...
@@ -456,13 +461,13 @@ class DetailModel
if
(
is_numeric
(
$productId
)
&&
is_numeric
(
$pageNum
)
&&
is_numeric
(
$pageSize
))
{
$commentList
=
DetailData
::
commentList
(
$productId
,
$pageNum
,
$pageSize
);
if
(
!
empty
(
$commentList
))
{
if
(
!
empty
(
$commentList
[
'data'
]
))
{
$build
=
array
();
foreach
(
$commentList
as
$value
)
{
$build
[
'userName'
]
=
''
;
$build
[
'desc'
]
=
''
;
$build
[
'content'
]
=
''
;
$build
[
'time'
]
=
''
;
foreach
(
$commentList
[
'data'
]
as
$value
)
{
$build
[
'userName'
]
=
$value
[
'nickname'
];
$build
[
'desc'
]
=
$value
[
'color_name'
]
.
'/'
.
$value
[
'size_name'
];
$build
[
'content'
]
=
$value
[
'content'
];
$build
[
'time'
]
=
$value
[
'create_time'
];
$result
[]
=
$build
;
}
}
...
...
Please
register
or
login
to post a comment