This commit is contained in:
wangjinlei
2021-02-25 15:03:13 +08:00
parent 540a2d7579
commit 49979c23f5
3 changed files with 90 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ class Mysystem extends Controller {
protected $sys_abs_obj = '';
protected $sys_scient_obj = '';
protected $sys_book_obj = '';
protected $sys_not_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -24,6 +25,7 @@ class Mysystem extends Controller {
$this->sys_abs_obj = Db::name('system_abstracting');
$this->sys_scient_obj = Db::name('system_scient');
$this->sys_book_obj = Db::name('system_books');
$this->sys_not_obj = Db::name('system_notices');
}
/**
@@ -381,6 +383,76 @@ class Mysystem extends Controller {
return jsonSuccess($re);
}
/**
* @title 增加出版集团消息
* @description 增加出版集团消息
* @author wangjinlei
* @url /master/Mysystem/addNotices
* @method POST
*
* @param name:title type:string require:1 desc:消息标题
* @param name:content type:string require:1 desc:内容
* @param name:ctime type:string require:1 desc:时间
*/
public function addNotices(){
$data = $this->request->post();
$insert['title'] = $data['title'];
$insert['content'] = $data['content'];
$insert['ctime'] = $data['ctime']==''?time():strtotime($data['ctime']);
$this->sys_not_obj->insert($insert);
return jsonSuccess([]);
}
/**
* @title 删除出版集团消息
* @description 删除出版集团消息
* @author wangjinlei
* @url /master/Mysystem/delNotices
* @method POST
*
* @param name:system_notices_id type:int require:1 desc:消息id
*/
public function delNotices(){
$data = $this->request->post();
$this->sys_not_obj->where('system_notices_id',$data['system_notices_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
/**
* @title 编辑出版集团消息
* @description 编辑出版集团消息
* @author wangjinlei
* @url /master/Mysystem/editNotices
* @method POST
*
* @param name:system_notices_id type:int require:1 desc:消息标题
* @param name:title type:string require:1 desc:消息标题
* @param name:content type:string require:1 desc:内容
*/
public function editNotices(){
$data = $this->request->post();
$update['title'] = $data['title'];
$update['content'] = $data['content'];
$this->sys_not_obj->where('system_notices_id',$data['system_notices_id'])->update($update);
return jsonSuccess([]);
}
/**
* @title 获取出版集团消息
* @description 获取出版集团消息
* @author wangjinlei
* @url /master/Mysystem/getNotices
* @method POST
*
* @return notices:消息array#
*/
public function getNotices(){
$data = $this->request->post();
$list = $this->sys_not_obj->where('state',0)->select();
$re['notices'] = $list;
return jsonSuccess($re);
}
/**
* @title pdf上传
* @description pdf上传