From 3c458560670093155e8674703d72fb93022a0d77 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Mon, 16 Nov 2020 10:40:15 +0800 Subject: [PATCH] 20201112 --- application/master/controller/Article.php | 30 ++++++++ application/master/controller/Journal.php | 84 +++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 application/master/controller/Article.php diff --git a/application/master/controller/Article.php b/application/master/controller/Article.php new file mode 100644 index 0000000..f8eeded --- /dev/null +++ b/application/master/controller/Article.php @@ -0,0 +1,30 @@ +admin_obj = Db::name('admin'); + $this->journal_obj = Db::name('journal'); + $this->journal_topic_obj = Db::name('journal_topic'); + } + + + + + +} diff --git a/application/master/controller/Journal.php b/application/master/controller/Journal.php index fc9a2d7..140b9a7 100644 --- a/application/master/controller/Journal.php +++ b/application/master/controller/Journal.php @@ -15,12 +15,14 @@ class Journal extends Controller { protected $admin_obj = ''; protected $journal_obj = ''; protected $journal_topic_obj = ''; + protected $journal_stage_obj = ''; public function __construct(\think\Request $request = null) { parent::__construct($request); $this->admin_obj = Db::name('admin'); $this->journal_obj = Db::name('journal'); $this->journal_topic_obj = Db::name('journal_topic'); + $this->journal_stage_obj = Db::name('journal_stage'); } /** @@ -424,5 +426,87 @@ class Journal extends Controller { } } + /** + * @title 添加期刊分期 + * @description 添加期刊分期 + * @author wangjinlei + * @url /master/Journal/addStage + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + * @param name:stage_name type:string require:1 desc:期刊分期名 + * + */ + public function addStage(){ + $data = $this->request->post(); + $insert_data['journal_id'] = $data['journal_id']; + $insert_data['stage_name'] = $data['stage_name']; + $res = $this->journal_stage_obj->insert($insert_data); + if($res){ + return json(['code'=>0,'msg'=>'success']); + }else{ + return json(['code'=>1,'msg'=>'system error']); + } + } + + /** + * @title 获取期刊分期 + * @description 获取期刊分期 + * @author wangjinlei + * @url /master/Journal/getStageList + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + * + * @return stage_list:array# + * + */ + public function getStageList(){ + $data = $this->request->post(); + $stage_list = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('state',0)->select(); + return json(['code'=>0,'msg'=>'success','data'=>['stage_list'=>$stage_list]]); + } + + /** + * @title 删除期刊分期 + * @description 删除期刊分期 + * @author wangjinlei + * @url /master/Journal/delStage + * @method POST + * + * @param name:journal_stage_id type:int require:1 desc:期刊分期id + * + */ + public function delStage(){ + $data = $this->request->post(); + $res = $this->journal_stage_obj->where('journal_stage_id',$data['journal_stage_id'])->update(['state'=>1]); + if($res){ + return json(['code'=>0,'msg'=>'success']); + }else{ + return json(['code'=>1,'msg'=>'system error']); + } + } + + /** + * @title 更改期刊分期 + * @description 更改期刊分期 + * @author wangjinlei + * @url /master/Journal/editStage + * @method POST + * + * @param name:journal_stage_id type:int require:1 desc:期刊分期id + * @param name:stage_name type:string require:1 desc:期刊分期名字 + * + */ + public function editStage(){ + $data = $this->request->post(); + $res = $this->journal_stage_obj->where('journal_stage_id',$data['journal_stage_id'])->update(['stage_name'=>$data['stage_name']]); + if($res){ + return json(['code'=>0,'msg'=>'success']); + }else{ + return json(['code'=>1,'msg'=>'system error']); + } + } + }