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
Rock Zhang
9 years ago
Commit
e6cacd4c7911eeb8cbe97aa990097b453a88ecc9
1 parent
9a002eb7
添加意见靠谱或者不靠谱接口
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletions
library/LibModels/Wap/Home/UserData.php
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
library/LibModels/Wap/Home/UserData.php
View file @
e6cacd4
...
...
@@ -322,6 +322,25 @@ class UserData
}
/**
* 意见靠谱,不靠谱接口
*
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $suggest_id 意见id
* @return array 接口返回的数据
*/
public
static
function
upAndDown
(
$uid
,
$udid
,
$suggest_id
)
{
$param
=
Yohobuy
::
param
();
$param
[
'uid'
]
=
$uid
;
$param
[
'udid'
]
=
$udid
;
$param
[
'content'
]
=
$suggest_id
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
SERVICE_URL
.
'suggest/api/v1/suggest/is_reliable'
,
$param
);
}
/**
* 提交意见反馈接口
*
* @param int $uid 用户ID
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
e6cacd4
...
...
@@ -48,7 +48,6 @@ class HomeController extends AbstractAction
'myIndexPage'
=>
true
,
'pageFooter'
=>
true
);
echo
$this
->
getRequest
()
->
getActionName
();
$uid
=
$this
->
getUid
();
if
(
$uid
)
{
$data
[
'isLogin'
]
=
true
;
...
...
@@ -430,6 +429,22 @@ class HomeController extends AbstractAction
}
/**
* 异步点击靠谱或者不靠谱
*/
public
function
upAndDownAction
()
{
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
();
$udid
=
$this
->
getUdid
();
$suggest_id
=
$this
->
post
(
'suggest_id'
,
0
);
$result
=
\Index\UserModel
::
upAndDown
(
$uid
,
$udid
,
$suggest_id
);
$this
->
echoJson
(
$result
);
}
}
/**
* 会员等级展示页
*/
public
function
gradeAction
()
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
e6cacd4
...
...
@@ -486,6 +486,34 @@ class UserModel
}
/**
* 处理意见靠谱,不靠谱接口返回结果
*
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $suggest_id 意见id
* @return array|mixed 处理之后的数据
*/
public
static
function
upAndDown
(
$uid
,
$udid
,
$suggest_id
)
{
$result
=
array
(
'code'
=>
400
,
'message'
=>
'出错啦'
);
if
(
empty
(
$suggest_id
))
{
$result
[
'code'
]
=
401
;
$result
[
'message'
]
=
'指定意见不存在'
;
}
else
{
// 调用接口
$save
=
UserData
::
upAndDown
(
$uid
,
$udid
,
$suggest_id
);
if
(
isset
(
$save
[
'code'
])
&&
$save
[
'code'
]
==
200
)
{
$result
[
'code'
]
=
200
;
$result
[
'message'
]
=
'操作成功'
;
}
}
return
$result
;
}
/**
* 处理我的消息数据
*
* @param int $uid 用户ID
...
...
Please
register
or
login
to post a comment