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
1df1092c
Commit
1df1092c
authored
Jul 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
1b0f0b96
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
UploadFileService.php
application/api_broker/service/UploadFileService.php
+2
-2
News.php
application/index/controller/News.php
+6
-5
No files found.
application/api_broker/service/UploadFileService.php
View file @
1df1092c
...
@@ -87,7 +87,7 @@ class UploadFileService
...
@@ -87,7 +87,7 @@ class UploadFileService
if
(
$info
)
{
if
(
$info
)
{
$data
[
'code'
]
=
200
;
$data
[
'code'
]
=
200
;
$data
[
"msg"
][
$k
][
'img_path'
]
=
$date
.
$info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
$k
][
'img_path'
]
=
$date
.
'/'
.
$info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
$k
][
'img_ext'
]
=
$info
->
getExtension
();
$data
[
"msg"
][
$k
][
'img_ext'
]
=
$info
->
getExtension
();
}
else
{
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
...
@@ -102,7 +102,7 @@ class UploadFileService
...
@@ -102,7 +102,7 @@ class UploadFileService
$info
=
$_file
->
validate
(
$valid_date
)
->
move
(
$path
,
$name_str
.
'.'
.
$file_info
[
'extension'
]);
$info
=
$_file
->
validate
(
$valid_date
)
->
move
(
$path
,
$name_str
.
'.'
.
$file_info
[
'extension'
]);
if
(
$info
)
{
if
(
$info
)
{
$data
[
'code'
]
=
200
;
$data
[
'code'
]
=
200
;
$data
[
"msg"
][
'img_path'
]
=
$date
.
$info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
'img_path'
]
=
$date
.
'/'
.
$info
->
getSaveName
();
//生成的图片路径
$data
[
"msg"
][
'img_ext'
]
=
$info
->
getExtension
();
$data
[
"msg"
][
'img_ext'
]
=
$info
->
getExtension
();
}
else
{
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
...
...
application/index/controller/News.php
View file @
1df1092c
...
@@ -84,17 +84,18 @@ class News extends Basic
...
@@ -84,17 +84,18 @@ class News extends Basic
return
$this
->
response
(
101
,
'内容为空!'
);
return
$this
->
response
(
101
,
'内容为空!'
);
}
}
if
(
empty
(
$_FILES
[
'file_img'
])
)
{
if
(
mb_strlen
(
$this
->
params
[
'content'
])
>
501
)
{
return
$this
->
response
(
101
,
'
封面图片为空
'
);
return
$this
->
response
(
101
,
'
内容字数超过限制!
'
);
}
}
$upload
=
new
UploadFileService
();
if
(
empty
(
$this
->
params
[
'file_img'
]))
{
$result
=
$upload
->
upload
(
$_FILES
[
'file_img'
],
'business_school'
);
return
$this
->
response
(
101
,
'封面图片为空'
);
}
$data
[
'title'
]
=
trim
(
$this
->
params
[
'title'
]);
$data
[
'title'
]
=
trim
(
$this
->
params
[
'title'
]);
$data
[
'content'
]
=
trim
(
$this
->
params
[
'content'
]);
$data
[
'content'
]
=
trim
(
$this
->
params
[
'content'
]);
$data
[
'publisher_id'
]
=
$this
->
userId
;
$data
[
'publisher_id'
]
=
$this
->
userId
;
$data
[
'cover_plan'
]
=
$
result
[
'msg'
][
'img_path
'
];
$data
[
'cover_plan'
]
=
$
this
->
params
[
'file_img
'
];
$num
=
$this
->
m_news
->
editData
(
$data
,
$this
->
params
[
'id'
]);
$num
=
$this
->
m_news
->
editData
(
$data
,
$this
->
params
[
'id'
]);
if
(
$num
<
1
)
{
if
(
$num
<
1
)
{
...
...
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