20201112
This commit is contained in:
@@ -1394,6 +1394,96 @@ http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
|
||||
$txt = ROOT_PATH . 'public' . DS . 'xml' . DS . 'all_1.xml';
|
||||
file_put_contents($txt, $xml);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 增加相关文章
|
||||
* @description 增加相关文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/addRelatedArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:add_article_id type:int require:1 desc:增加的文章id
|
||||
*/
|
||||
public function addRelatedArticle(){
|
||||
$data = $this->request->post();
|
||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||
$frag = [];
|
||||
if($article_info['related']==""){
|
||||
$frag[] = $data['add_article_id'];
|
||||
}else{
|
||||
if(in_array($data['add_article_id'], object_to_array(json_decode($article_info['related'])))){
|
||||
return jsonError("重复添加!!");
|
||||
}
|
||||
$frag = array_merge(object_to_array(json_decode($article_info['related'])),[$data['add_article_id']]);
|
||||
}
|
||||
$this->article_obj->where("article_id",$data['article_id'])->update(['related'=> json_encode($frag)]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 删除相关文章
|
||||
* @description 删除相关文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/delRelatedArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:del_article_id type:int require:1 desc:增加的文章id
|
||||
*/
|
||||
public function delRelatedArticle(){
|
||||
$data = $this->request->post();
|
||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||
$frag = object_to_array(json_decode($article_info['related']));
|
||||
foreach ($frag as $k => $v){
|
||||
if($v==$data['del_article_id']){
|
||||
unset($frag[$k]);
|
||||
}
|
||||
}
|
||||
$this->article_obj->where("article_id",$data['article_id'])->update(['related'=> json_encode($frag)]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取相关文章
|
||||
* @description 获取相关文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/getRelatedArticles
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*
|
||||
* @return articles:文章列表#
|
||||
*/
|
||||
public function getRelatedArticles(){
|
||||
$data = $this->request->post();
|
||||
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
|
||||
$list = $this->article_obj->where("article_id","in", object_to_array(json_decode($article_info['related'])))->select();
|
||||
$re['articles'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取期刊分期文章
|
||||
* @description 获取期刊分期文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/getArticlesByStages
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
* @return stages:文章列表#
|
||||
*/
|
||||
public function getArticlesByStages(){
|
||||
$data = $this->request->post();
|
||||
//获取期刊分期
|
||||
$stage = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where("state",0)->order('stage_vol desc,stage_no')->select();
|
||||
foreach ($stage as $k => $v){
|
||||
$stage[$k]['articles'] = $this->article_obj->where('journal_stage_id',$v['journal_stage_id'])->where('state',0)->select();
|
||||
}
|
||||
$re['stages'] = $stage;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 注册doi
|
||||
|
||||
Reference in New Issue
Block a user