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
0c4a7e36
Commit
0c4a7e36
authored
Dec 03, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
6311256d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
News.php
application/index/controller/News.php
+28
-13
SNews.php
application/model/SNews.php
+1
-1
route.php
application/route.php
+1
-1
No files found.
application/index/controller/News.php
View file @
0c4a7e36
...
...
@@ -136,7 +136,7 @@ class News extends Basic
if
(
empty
(
$this
->
params
[
'id'
]))
{
return
$this
->
response
(
101
,
"Id is null."
);
}
$field
=
'id,title,s_label_id,cover_plan,content,annex_file_name
,file_former_name
'
;
$field
=
'id,title,s_label_id,cover_plan,content,annex_file_name'
;
$where
[
'status'
]
=
0
;
$where
[
'id'
]
=
$this
->
params
[
'id'
];
$data
=
$this
->
m_news
->
getNewsInfo
(
$field
,
$where
);
...
...
@@ -204,18 +204,32 @@ class News extends Basic
public
function
downloadFile
()
{
$filepath
=
'/static/business_school_file/20181203/20181203110021473.jpg'
;
if
(
file_exists
(
$filepath
)){
header
(
"Content-type:application/octet-stream"
);
$filename
=
basename
(
$filepath
);
header
(
"Content-Disposition:attachment;filename = 11.jpg"
);
header
(
"Accept-ranges:bytes"
);
header
(
"Accept-length:"
.
filesize
(
$filepath
));
readfile
(
$filepath
);
}
else
{
echo
"<script>alert('文件不存在')</script>"
;
}
$data
[]
=
[
'file_name'
=>
'12'
,
'file_former_name'
=>
'44'
];
$data
[]
=
[
'file_name'
=>
'12'
,
'file_former_name'
=>
'44'
];
return
$this
->
response
(
200
,
$data
);
// dump(666);exit;
// $this->params['file_name']= '20181203/20181203110021473.jpg';
// $this->params['file_former_name']='ceshi.jpg';
// if (empty($this->params['file_name']) or empty($this->params['file_former_name'])) {
// echo "<script>alert('文件不存在')</script>";
// }
//
// $file_name = $this->params['file_name'];
// $file_former_name = $this->params['file_former_name'];
//
// $filepath = ROOT_PATH . 'public/static/business_school_file/'.$file_name;
// if(file_exists($filepath)){
// header("Content-type:application/octet-stream");
// $filename = basename($filepath);
// header("Content-Disposition:attachment;filename = {$file_former_name}");
// header("Accept-ranges:bytes");
// header("Accept-length:".filesize($filepath));
// readfile($filepath);
// }else{
// echo "<script>alert('文件不存在')</script>";
// }
}
}
\ No newline at end of file
application/model/SNews.php
View file @
0c4a7e36
...
...
@@ -87,7 +87,7 @@ class SNews extends BaseModel
->
find
();
$file
=
$this
->
db_
->
table
(
's_file'
)
->
field
(
'id as file_id,file_name'
)
->
field
(
'id as file_id,file_name
,file_former_name
'
)
->
where
(
'new_id'
,
$params
[
'id'
])
->
where
(
'status'
,
0
)
->
select
();
...
...
application/route.php
View file @
0c4a7e36
...
...
@@ -370,7 +370,7 @@ Route::group('index', [
'getRecordsList'
=>
[
'index/broker/getRecordsList'
,
[
'method'
=>
'post|get'
]],
//解绑或绑定经纪人设备id
'downloadFile'
=>
[
'index/news/downloadFile'
,
[
'method'
=>
'POST'
]],
//新增商学院资讯
'downloadFile'
=>
[
'index/news/downloadFile'
,
[
'method'
=>
'
GET|
POST'
]],
//新增商学院资讯
]);
...
...
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