diff --git a/application/master/controller/Article.php b/application/master/controller/Article.php index 2c297c6..50d94d7 100644 --- a/application/master/controller/Article.php +++ b/application/master/controller/Article.php @@ -155,6 +155,16 @@ class Article extends Controller { */ public function editArticleAuthor(){ $data = $this->request->post(); + +// $data['article_author_id'] = 21; +// $data['article_id'] = 38; +// $data['author_name'] = '作者3'; +// $data['author_country'] = 'Netherlands'; +// $data['is_first'] = 1; +// $data['is_report'] = 1; +// $data['email'] = 'xl37@163.com'; +// $data['organs'] = ['1','2','3']; + $old_article_author_info = $this->article_author_obj->where('article_author_id',$data['article_author_id'])->find(); $update_author['author_name'] = $data['author_name']; $update_author['author_country'] = $data['author_country']; @@ -181,6 +191,24 @@ class Article extends Controller { return json(['code'=>0,'msg'=>'success']); } + /** + * @title 删除文章作者 + * @description 删除文章作者 + * @author wangjinleichang + * @url /master/Article/delArticleAuthor + * @method POST + * + * @param name:article_author_id type:int require:1 desc:article_id + * + */ + public function delArticleAuthor(){ + $data = $this->request->post(); + //删除作者和机构的关系 + $this->author_to_organ_obj->where('article_author_id',$data['article_author_id'])->update(['state'=>1]); + $this->article_author_obj->where('article_author_id',$data['article_author_id'])->update(['state'=>1]); + return json(['code'=>0,'msg'=>'success']); + } + /** * @title 获取文章作者和机构 * @description 获取文章作者和机构 @@ -235,6 +263,39 @@ class Article extends Controller { } } + /** + * @title 编辑文章作者机构 + * @description 编辑文章作者机构 + * @author wangjinleichang + * @url /master/Article/editArticleOrgan + * @method POST + * + * @param name:article_organ_id type:int require:1 desc:article_organ_id + * @param name:organ_name type:string require:1 desc:机构名字 + */ + public function editArticleOrgan(){ + $data = $this->request->post(); + $this->article_organ_obj->where('article_organ_id',$data['article_organ_id'])->update(['organ_name'=>$data['organ_name']]); + return json(['code'=>0,'msg'=>'success']); + } + + /** + * @title 删除文章作者机构 + * @description 删除文章作者机构 + * @author wangjinleichang + * @url /master/Article/delArticleOrgan + * @method POST + * + * @param name:article_organ_id type:int require:1 desc:article_organ_id + */ + public function delArticleOrgan(){ + $data = $this->request->post(); + //删除作者和机构的关系 + $this->author_to_organ_obj->where('article_organ_id',$data['article_organ_id'])->update(['state'=>1]); + $this->article_organ_obj->where('article_organ_id',$data['article_organ_id'])->update(['state'=>1]); + return json(['code'=>0,'msg'=>'success']); + } + /** * @title 获取文章基本信息 * @description 获取文章基本信息