Commit e2e99ac0 authored by clone's avatar clone

Merge branch '0702-v.2.2.0' of https://gitee.com/zwyjjc/tl_estate into 0702-v.2.2.0

parents 768ff0b1 c84bafc5
......@@ -87,7 +87,7 @@ class UploadFileService
if ($info) {
$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();
} else {
$data['code'] = 101;
......@@ -102,7 +102,7 @@ class UploadFileService
$info = $_file->validate($valid_date)->move($path, $name_str . '.' . $file_info['extension']);
if ($info) {
$data['code'] = 200;
$data["msg"]['img_path'] = $date . $info->getSaveName(); //生成的图片路径
$data["msg"]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径
$data["msg"]['img_ext'] = $info->getExtension();
} else {
$data['code'] = 101;
......
......@@ -84,17 +84,18 @@ class News extends Basic
return $this->response(101, '内容为空!');
}
if (empty($_FILES['file_img'])) {
return $this->response(101, '封面图片为空');
if (mb_strlen($this->params['content']) > 501) {
return $this->response(101, '内容字数超过限制!');
}
$upload = new UploadFileService();
$result = $upload->upload($_FILES['file_img'], 'business_school');
if (empty($this->params['file_img'])) {
return $this->response(101, '封面图片为空');
}
$data['title'] = trim($this->params['title']);
$data['content'] = trim($this->params['content']);
$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']);
if ($num < 1) {
......@@ -155,4 +156,8 @@ class News extends Basic
$data = $label->getList(1, 200, '', 'id,label_name', ['status'=>0]);
return $this->response(200, '', $data);
}
public function newText() {
return view('new_text');
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -251,6 +251,7 @@ Route::group('index', [
'getNewsInfo' => [ 'index/news/getNewsInfo', [ 'method' => 'GET' ] ], //商学院资讯详情
'getNewsLabel' => [ 'index/news/getNewsLabel', [ 'method' => 'GET' ] ], //商学院资标签
'delNews' => [ 'index/news/delNews', [ 'method' => 'POST' ] ], //删除商学院文章
'new_text' => [ 'index/news/newText', [ 'method' => 'GET' ] ], //删除商学院文章
'agentEvaluateNumAndFraction' => [ 'index/agent/agentEvaluateNumAndFraction', [ 'method' => 'POST|GET' ] ],//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'uploadImg' => [ 'index/UploadImg/uploadImg', [ 'method' => 'POST' ] ],//全局图片上传
]);
......
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