Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
bb2b3554
Commit
bb2b3554
authored
Feb 15, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
头像上传
parent
c63eb420
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Member.php
application/api/controller/Member.php
+8
-4
No files found.
application/api/controller/Member.php
View file @
bb2b3554
...
...
@@ -446,12 +446,14 @@ class Member extends Basic
if
(
$info
){
if
(
$this
->
userId
)
{
$user
=
new
Users
();
$user_data
=
$user
->
field
(
'user_pic'
)
->
where
(
'id'
,
$this
->
userId
)
->
find
();
@
unlink
(
$path
.
DS
.
$user_data
->
user_pic
);
//删除原来的图片
$user_pic
=
$user
->
getUserByWhereValue
(
'user_pic'
,
[
'id'
=>
$this
->
userId
]);
// $user_data = $user->field('user_pic')->where('id',$this->userId)->find();
@
unlink
(
$path
.
DS
.
$user_pic
);
//删除原来的图片
$img_path
=
$info
->
getSaveName
();
//生成的图片路径
//更新用户信息
$user_data
->
user_pic
=
$img_path
;
$user_data
->
save
();
// $user_data->user_pic = $img_path;
// $user_data->save();
$user
->
updateUsers
(
$this
->
userId
,
[
'user_pic'
=>
$img_path
]);
$static_path
=
$path
.
DS
.
$img_path
;
//生成图片的绝对路径
$image
=
\think\Image
::
open
(
$static_path
);
...
...
@@ -460,6 +462,8 @@ class Member extends Basic
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
'上传成功'
;
$data
[
'data'
]
=
[
'file_name'
=>
HEADERIMGURL
.
$img_path
];
}
else
{
$data
[
'msg'
]
=
'用户信息错误'
;
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment