Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
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
Rock Zhang
2016-01-07 14:44:30 +0800
Commit
ca7d86e8e4029bf3832f6ea96b31424972a58e82
1 parent
a5b897fc
添加商品咨询页面中常见问题的数据获取接口
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
library/LibModels/Wap/Product/DetailData.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
library/LibModels/Wap/Product/DetailData.php
View file @
ca7d86e
...
...
@@ -88,6 +88,20 @@ class DetailData
}
/**
* 常见问题列表
*
* @return array
*/
public
static
function
commonConsultList
()
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.consult.common'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 评论内容列表
*
* @param int $productId 产品ID
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
ca7d86e
...
...
@@ -584,6 +584,24 @@ class DetailModel
}
/**
* 获取常见问题列表
*
* @return array
*/
public
static
function
getCommonConsults
()
{
$result
=
array
();
$consults
=
DetailData
::
commonConsultList
();
if
(
isset
(
$consults
[
'code'
])
&&
$consults
[
'code'
]
===
200
)
{
$result
[
'commonConsults'
]
=
$consults
[
'data'
];
$consults
=
array
();
}
return
$result
;
}
/**
* 咨询点赞
*
* @param int $uid 用户ID
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
View file @
ca7d86e
...
...
@@ -167,6 +167,25 @@ class DetailController extends AbstractAction
}
/*
* 异步获取咨询常见问题
*/
public
function
commonconsultsAction
()
{
$result
=
array
();
if
(
$this
->
isAjax
())
{
$result
=
\Product\DetailModel
::
getCommonConsults
();
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
print_r
(
$result
);
$this
->
_view
->
display
(
'common-consults'
,
$result
);
}
}
/*
* 咨询点赞
*/
public
function
consultupvoteAction
()
...
...
Please
register
or
login
to post a comment