20201112
This commit is contained in:
@@ -141,7 +141,19 @@ class Article extends Controller {
|
||||
$data = $this->request->post();
|
||||
|
||||
$insert_author['article_id'] = $data['article_id'];
|
||||
$insert_author['author_name'] = $data['author_name'];
|
||||
$insert_author['author_name'] = trim($data['author_name']);
|
||||
//处理名字
|
||||
$ca = explode(' ', $insert_author['author_name']);
|
||||
$caf = '';
|
||||
$cal = '';
|
||||
if(isset($ca[0])){
|
||||
$caf = str_replace('-', '', $ca[0]);
|
||||
}
|
||||
if(isset($ca[1])){
|
||||
$cal = $ca[1];
|
||||
}
|
||||
$insert_author['first_name'] = $caf;
|
||||
$insert_author['last_name'] = $cal;
|
||||
$insert_author['author_country'] = $data['author_country'];
|
||||
$insert_author['is_first'] = $data['is_first'];
|
||||
$insert_author['is_report'] = $data['is_report'];
|
||||
@@ -195,7 +207,20 @@ class Article extends Controller {
|
||||
// $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_name'] = trim($data['author_name']);
|
||||
//处理名字
|
||||
$ca = explode(' ', $update_author['author_name']);
|
||||
$caf = '';
|
||||
$cal = '';
|
||||
if(isset($ca[0])){
|
||||
$caf = str_replace('-', '', $ca[0]);
|
||||
}
|
||||
if(isset($ca[1])){
|
||||
$cal = $ca[1];
|
||||
}
|
||||
$update_author['first_name'] = $caf;
|
||||
$update_author['last_name'] = $cal;
|
||||
|
||||
$update_author['author_country'] = $data['author_country'];
|
||||
$update_author['is_first'] = $data['is_first'];
|
||||
$update_author['is_report'] = $data['is_report'];
|
||||
@@ -698,6 +723,23 @@ class Article extends Controller {
|
||||
return json(['code'=>1,'msg'=>'system error']);
|
||||
}
|
||||
}
|
||||
|
||||
public function mycc(){
|
||||
$list = $this->article_author_obj->where('article_author_id','>',5126)->select();
|
||||
foreach ($list as $v){
|
||||
$ca = explode(' ', $v['author_name']);
|
||||
$caf = '';
|
||||
$cal = '';
|
||||
if(isset($ca[0])){
|
||||
$caf = str_replace('-', '', $ca[0]);
|
||||
}
|
||||
if(isset($ca[1])){
|
||||
$cal = $ca[1];
|
||||
}
|
||||
$this->article_author_obj->where('article_author_id',$v['article_author_id'])->update(['first_name'=>$caf,'last_name'=>$cal]);
|
||||
}
|
||||
echo 'over';
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 图片上传
|
||||
|
||||
@@ -17,6 +17,8 @@ class Mysystem extends Controller {
|
||||
protected $sys_scient_obj = '';
|
||||
protected $sys_book_obj = '';
|
||||
protected $sys_not_obj = '';
|
||||
protected $de_topic_obj = '';
|
||||
protected $de_topic_to_article = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
@@ -26,6 +28,8 @@ class Mysystem extends Controller {
|
||||
$this->sys_scient_obj = Db::name('system_scient');
|
||||
$this->sys_book_obj = Db::name('system_books');
|
||||
$this->sys_not_obj = Db::name('system_notices');
|
||||
$this->de_topic_obj = Db::name('de_topic');
|
||||
$this->de_topic_to_article = Db::name('de_topic_to_article');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -452,6 +456,187 @@ class Mysystem extends Controller {
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 增加总话题
|
||||
* @description 增加总话题
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/addTopic
|
||||
* @method POST
|
||||
*
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:intro type:string require:0 desc:简介
|
||||
* @param name:icon type:string require:1 desc:图片地址
|
||||
*
|
||||
*/
|
||||
public function addTopic(){
|
||||
$data = $this->request->post();
|
||||
$insert['title'] = trim($data['title']);
|
||||
$insert['intro'] = isset($data['intro'])?trim($data['intro']):'';
|
||||
$insert['icon'] = $data['icon'];
|
||||
$this->de_topic_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 删除总话题
|
||||
* @description 删除总话题
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/delTopic
|
||||
* @method POST
|
||||
*
|
||||
* @param name:de_topic_id type:int require:1 desc:主键id
|
||||
*
|
||||
*/
|
||||
public function delTopic(){
|
||||
$data = $this->request->post();
|
||||
$this->de_topic_obj->where('de_topic_id',$data['de_topic_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑总话题
|
||||
* @description 编辑总话题
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/editTopic
|
||||
* @method POST
|
||||
*
|
||||
* @param name:de_topic_id type:int require:1 desc:主键id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:intro type:string require:0 desc:简介
|
||||
* @param name:icon type:string require:1 desc:图片地址
|
||||
*
|
||||
*/
|
||||
public function editTopic(){
|
||||
$data = $this->request->post();
|
||||
$update['title'] = trim($data['title']);
|
||||
$update['intro'] = isset($data['intro'])?trim($data['intro']):'';
|
||||
$update['icon'] = $data['icon'];
|
||||
$this->de_topic_obj->where('de_topic_id',$data['de_topic_id'])->update($update);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取总话题列表
|
||||
* @description 获取总话题列表
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/getTopicList
|
||||
* @method POST
|
||||
*
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码数
|
||||
* @param name:pageSize type:int require:1 desc:单页数据条数
|
||||
*
|
||||
* @return topics:topic@
|
||||
* @return count:总数
|
||||
* @topics title:标题 intro:简介 icon:图片路径
|
||||
*/
|
||||
public function getTopicList(){
|
||||
$data = $this->request->post();
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$list = $this->de_topic_obj->where('state',0)->limit($limit_start,$data['pageSize'])->select();
|
||||
$count = $this->de_topic_obj->where('state',0)->count();
|
||||
|
||||
$re['topics'] = $list;
|
||||
$re['count'] = $count;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加话题文章对应关系
|
||||
* @description 添加话题文章对应关系
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/addTopicToArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:de_topic_id type:int require:1 desc:话题id
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*/
|
||||
public function addTopicToArticle(){
|
||||
$data = $this->request->post();
|
||||
$insert['de_article_id'] = $data['de_article_id'];
|
||||
$insert['article_id'] = $data['article_id'];
|
||||
$this->de_topic_to_article->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 删除话题文章对应关系
|
||||
* @description 删除话题文章对应关系
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/delTopicToArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:de_topic_to_article_id type:int require:1 desc:对应关系id
|
||||
*/
|
||||
public function delTopicToArticle(){
|
||||
$data = $this->request->post();
|
||||
$this->de_topic_to_article->where('de_topic_to_article_id',$data['de_topic_to_article_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取话题通过文章
|
||||
* @description 获取话题通过文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/getTopicByArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码数
|
||||
* @param name:pageSize type:int require:1 desc:单页数据条数
|
||||
*
|
||||
* @return topics:topic@
|
||||
* @return count:总数
|
||||
* @topics title:标题 intro:简介 icon:图片路径
|
||||
*/
|
||||
public function getTopicByArticle(){
|
||||
$data = $this->request->post();
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$list = $this->de_topic_to_article
|
||||
->field('j_de_topic.*')
|
||||
->join('j_de_topic','j_de_topic_to_article.de_topic_id = j_de_topic.de_topic_id','LEFT')
|
||||
->where('j_de_topic_to_article.article_id',$data['article_id'])
|
||||
->where('j_de_topic_to_article.state',0)
|
||||
->limit($limit_start,$data['pageSize'])
|
||||
->select();
|
||||
$count = $this->de_topic_to_article->where('state',0)->where('article_id',$data['article_id'])->count();
|
||||
|
||||
$re['topics'] = $list;
|
||||
$re['count'] = $count;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取文章通过话题
|
||||
* @description 获取文章通过话题
|
||||
* @author wangjinlei
|
||||
* @url /master/Mysystem/getArticleByTopic
|
||||
* @method POST
|
||||
*
|
||||
* @param name:de_topic_id type:int require:1 desc:话题id
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码数
|
||||
* @param name:pageSize type:int require:1 desc:单页数据条数
|
||||
*
|
||||
* @return articles:article@
|
||||
* @return count:总数
|
||||
* @articles title:标题 type:类型 icon:图片路径 doi:doi号
|
||||
*/
|
||||
public function getArticleByTopic(){
|
||||
$data = $this->request->post();
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$list = $this->de_topic_to_article
|
||||
->field('j_article.*')
|
||||
->join('j_article','j_de_topic_to_article.article_id = j_article.article_id','LEFT')
|
||||
->where('j_de_topic_to_article.de_topic_id',$data['de_topic_id'])
|
||||
->where('j_de_topic_to_article.state',0)
|
||||
->limit($limit_start,$data['pageSize'])
|
||||
->select();
|
||||
$count = $this->de_topic_to_article->where('state',0)->where('de_topic_id',$data['de_topic_id'])->count();
|
||||
|
||||
$re['articles'] = $list;
|
||||
$re['count'] = $count;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title pdf上传
|
||||
* @description pdf上传
|
||||
|
||||
Reference in New Issue
Block a user