Commit 4911a01a authored by zhuwei's avatar zhuwei

文件下载

parent 84c72911
...@@ -206,17 +206,17 @@ class News extends Basic ...@@ -206,17 +206,17 @@ class News extends Basic
* *
*/ */
public function downloadFile() { public function downloadFile() {
// $this->params['file_id'] = 142;
if (empty($this->params['file_id'])) { if (!isset($this->params['file_id']) ) {
echo "<script>alert('文件不存在')</script>"; return $this->response(101, "Id is null.");
} }
$field = 'id,file_name,annex_file_name';
$field = 'id,file_name,file_former_name';
$where['status'] = 0; $where['status'] = 0;
$where['id'] = $this->params['file_id']; $where['id'] = $this->params['file_id'];
$m_file = new SFile(); $m_file = new SFile();
$data = $m_file->getFileById($field, $where); $data = $m_file->getFileById($field, $where);
$file_name = $data['file_name']; $file_name = $data['file_name'];
$file_former_name = $data['file_former_name']; $file_former_name = $data['file_former_name'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment