Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
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
chenchuanwen
my-yaf-project
Commits
70db1b27
Commit
70db1b27
authored
Sep 19, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存头像
parent
3455d3d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
CommonService.php
application/models/Business/Common/CommonService.php
+18
-5
No files found.
application/models/Business/Common/CommonService.php
View file @
70db1b27
...
@@ -46,6 +46,23 @@ class CommonServiceModel extends \Business\AbstractModel
...
@@ -46,6 +46,23 @@ class CommonServiceModel extends \Business\AbstractModel
return
$result
;
return
$result
;
}
}
private
function
saveWxImage
(
$data
)
{
$fileName
=
$data
[
'image'
];
if
(
!
empty
(
$_FILES
[
$fileName
][
'tmp_name'
]))
{
$savePath
=
ImageConst
::
uploadTypes
[
$data
[
'type'
]];
$res
=
ImageUtil
::
uploadImage
(
$_FILES
[
$fileName
][
'tmp_name'
],
$savePath
,
ImageUtil
::
getFileName
(
$data
[
'type'
]));
$fileName
=
basename
(
$res
);
return
array
(
'fileName'
=>
$fileName
,
'url'
=>
$res
);
}
return
new
\stdClass
();
}
public
function
saveImage
(
$data
)
public
function
saveImage
(
$data
)
{
{
...
@@ -60,11 +77,7 @@ class CommonServiceModel extends \Business\AbstractModel
...
@@ -60,11 +77,7 @@ class CommonServiceModel extends \Business\AbstractModel
//如过是微信
//如过是微信
$requstDriver
=
Common
::
getDriverType
();
$requstDriver
=
Common
::
getDriverType
();
if
(
$requstDriver
==
ApiConst
::
wxType
||
(
isset
(
$data
[
'name'
])
&&!
empty
(
$data
[
'name'
])))
{
if
(
$requstDriver
==
ApiConst
::
wxType
||
(
isset
(
$data
[
'name'
])
&&!
empty
(
$data
[
'name'
])))
{
$returnData
=
\Our\ImageUtil
::
saveWxImage
(
$data
);
return
$this
->
saveWxImage
(
$data
);
if
(
!
$returnData
){
$returnData
=
new
\stdClass
();
}
return
$returnData
;
}
}
$time
=
date
(
'YmdHis_'
);
$time
=
date
(
'YmdHis_'
);
$fileName
=
$time
.
\Our\Validate
::
getNumberString
();
$fileName
=
$time
.
\Our\Validate
::
getNumberString
();
...
...
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