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
13d1f97a4b3ea3e31e614476ee876f4b19f4ab53
1 parent
490d1961
给意见反馈添加图片选项
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
library/LibModels/Wap/Home/UserData.php
library/Plugin/Images.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 @
13d1f97
...
...
@@ -344,14 +344,18 @@ class UserData
*
* @param int $uid 用户ID
* @param string $content 意见内容
* @param mixed $image 图片地址
* @param int $suggest_type 意见类型
* @return array 意见反馈接口返回的数据
*/
public
static
function
savesuggestData
(
$uid
,
$content
,
$suggest_type
)
public
static
function
savesuggestData
(
$uid
,
$content
,
$
image
,
$
suggest_type
)
{
$param
=
Yohobuy
::
param
();
$param
[
'uid'
]
=
$uid
;
$param
[
'content'
]
=
$content
;
if
(
$image
!==
null
)
{
$param
[
'image'
]
=
$image
;
}
$param
[
'suggest_type'
]
=
$suggest_type
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
...
...
library/Plugin/Images.php
View file @
13d1f97
...
...
@@ -187,7 +187,11 @@ class Images
if
(
count
(
$file
)
==
1
||
!
is_array
(
$file
))
{
$imgList
[
'imgList'
][]
=
array
(
'imgUrl'
=>
self
::
getSourceUrl
(
current
(
$result
[
'data'
][
'imagesList'
]),
'suggest'
)
.
$imgExtra
);
$imgRelUrl
=
current
(
$result
[
'data'
][
'imagesList'
]);
$imgList
[
'imgList'
][]
=
array
(
'imgUrl'
=>
self
::
getSourceUrl
(
$imgRelUrl
,
'suggest'
)
.
$imgExtra
,
'imgRelUrl'
=>
$imgRelUrl
);
}
else
{
...
...
@@ -195,6 +199,7 @@ class Images
foreach
(
$result
[
'data'
][
'imagesList'
]
as
$val
)
{
$img
=
array
();
$img
[
'imgUrl'
]
=
self
::
getSourceUrl
(
$val
,
'suggest'
)
.
$imgExtra
;
$img
[
'imgRelUrl'
]
=
$val
;
$imgList
[
'imgList'
][]
=
$img
;
}
}
...
...
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
13d1f97
...
...
@@ -384,7 +384,8 @@ class HomeController extends AbstractAction
$uid
=
$this
->
getUid
();
$content
=
$this
->
post
(
'content'
,
''
);
$suggest_type
=
$this
->
post
(
'suggest_type'
,
2
);
$result
=
\Index\UserModel
::
saveSuggestData
(
$uid
,
$content
,
$suggest_type
);
$image
=
$this
->
post
(
'image'
,
null
);
$result
=
\Index\UserModel
::
saveSuggestData
(
$uid
,
$content
,
$image
,
$suggest_type
);
$this
->
echoJson
(
$result
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
13d1f97
...
...
@@ -487,15 +487,16 @@ class UserModel
*
* @param int $uid 用户ID
* @param string $content 意见内容
* @param mixed $image 图片地址
* @param int $suggest_type 意见类型
* @return array|mixed 保存意见反馈数据之后的返回
*/
public
static
function
saveSuggestData
(
$uid
,
$content
,
$suggest_type
)
public
static
function
saveSuggestData
(
$uid
,
$content
,
$
image
,
$
suggest_type
)
{
$result
=
array
(
'code'
=>
400
,
'message'
=>
'保存出错'
);
// 调用接口保存意见反馈数据
$save
=
UserData
::
savesuggestData
(
$uid
,
$content
,
$suggest_type
);
$save
=
UserData
::
savesuggestData
(
$uid
,
$content
,
$
image
,
$
suggest_type
);
if
(
isset
(
$save
[
'code'
])
&&
$save
[
'code'
]
==
200
)
{
$result
[
'code'
]
=
200
;
...
...
Please
register
or
login
to post a comment