1
This commit is contained in:
@@ -459,7 +459,7 @@ class Article extends Controller {
|
|||||||
$list[$k]['mains'] = [];//getArticleMains($v['article_id']);
|
$list[$k]['mains'] = [];//getArticleMains($v['article_id']);
|
||||||
$cm = $this->article_main_obj->where('article_id',$v['article_id'])->where('state',0)->find();
|
$cm = $this->article_main_obj->where('article_id',$v['article_id'])->where('state',0)->find();
|
||||||
$list[$k]['has_mains'] = $cm?1:0;
|
$list[$k]['has_mains'] = $cm?1:0;
|
||||||
$list[$k]["cite_num"] = $this->article_cite_obj->where("article_id",$v['article_id'])->where("state",1)->count();
|
$list[$k]["cite_num"] = $this->article_cite_obj->where("article_id",$v['article_id'])->where("state",1)->where("is_wos",1)->count();
|
||||||
}
|
}
|
||||||
//标题斜体
|
//标题斜体
|
||||||
foreach ($list as $k => $v) {
|
foreach ($list as $k => $v) {
|
||||||
@@ -614,7 +614,7 @@ class Article extends Controller {
|
|||||||
if(!$rule->check($data)){
|
if(!$rule->check($data)){
|
||||||
return jsonError($rule->getError());
|
return jsonError($rule->getError());
|
||||||
}
|
}
|
||||||
$list = $this->article_cite_obj->where("article_id",$data['article_id'])->where("state",1)->select();
|
$list = $this->article_cite_obj->where("article_id",$data['article_id'])->where("state",1)->where("is_wos",1)->select();
|
||||||
$re['list'] = $list;
|
$re['list'] = $list;
|
||||||
|
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
|
|||||||
@@ -657,7 +657,7 @@ class Journal extends Controller {
|
|||||||
$list[$k]['mains'] = [];//getArticleMains($v['article_id']);
|
$list[$k]['mains'] = [];//getArticleMains($v['article_id']);
|
||||||
$cm = $this->article_main_obj->where('article_id',$v['article_id'])->where('state',0)->find();
|
$cm = $this->article_main_obj->where('article_id',$v['article_id'])->where('state',0)->find();
|
||||||
$list[$k]['has_mains'] = $cm?1:0;
|
$list[$k]['has_mains'] = $cm?1:0;
|
||||||
$list[$k]["cite_num"] = $this->article_cite_obj->where("article_id",$v['article_id'])->where("state",1)->count();
|
$list[$k]["cite_num"] = $this->article_cite_obj->where("article_id",$v['article_id'])->where("state",1)->where("is_wos",1)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取作者
|
//获取作者
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use think\Db;
|
|||||||
use ip\IpLocation;
|
use ip\IpLocation;
|
||||||
use ipserv\iplimit;
|
use ipserv\iplimit;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 前段web接口
|
* @title 前段web接口
|
||||||
@@ -316,7 +317,7 @@ class Main extends Controller {
|
|||||||
}
|
}
|
||||||
$list[$k]['title'] = $cache_title;
|
$list[$k]['title'] = $cache_title;
|
||||||
}
|
}
|
||||||
//连续出版判断,决定是否显示出版时间
|
//连续出版判断,决定是否显示出版时间
|
||||||
foreach ($list as $k => $v){
|
foreach ($list as $k => $v){
|
||||||
$ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
$ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||||
if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){
|
if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){
|
||||||
@@ -328,6 +329,87 @@ class Main extends Controller {
|
|||||||
$re['articles'] = $list;
|
$re['articles'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getCitedTopArticles(){
|
||||||
|
//tmr两条 mdm一条 bmec一条
|
||||||
|
$s_time = strtotime("-3 year");
|
||||||
|
|
||||||
|
$tmr_list = $this->article_obj->field("j_article.*,COUNT(j_article_cite.article_cite_id) as cite_num")
|
||||||
|
->join("j_article_cite","j_article_cite.article_id = j_article.article_id","left")
|
||||||
|
->where("j_article.ctime",">",$s_time)
|
||||||
|
->where("j_article.journal_id",1)
|
||||||
|
->where("j_article_cite.state",1)
|
||||||
|
->where("j_article_cite.is_wos",1)
|
||||||
|
->group("j_article.article_id")
|
||||||
|
->order("cite_num desc")
|
||||||
|
->limit(2)
|
||||||
|
->select();
|
||||||
|
|
||||||
|
$bmec_list = $this->article_obj->field("j_article.*,COUNT(j_article_cite.article_cite_id) as cite_num")
|
||||||
|
->join("j_article_cite","j_article_cite.article_id = j_article.article_id","left")
|
||||||
|
->where("j_article.ctime",">",$s_time)
|
||||||
|
->where("j_article.journal_id",25)
|
||||||
|
->where("j_article_cite.state",1)
|
||||||
|
->where("j_article_cite.is_wos",1)
|
||||||
|
->group("j_article.article_id")
|
||||||
|
->order("cite_num desc")
|
||||||
|
->limit(1)
|
||||||
|
->select();
|
||||||
|
|
||||||
|
$mdm_list = $this->article_obj->field("j_article.*,COUNT(j_article_cite.article_cite_id) as cite_num")
|
||||||
|
->join("j_article_cite","j_article_cite.article_id = j_article.article_id","left")
|
||||||
|
->where("j_article.ctime",">",$s_time)
|
||||||
|
->where("j_article.journal_id",11)
|
||||||
|
->where("j_article_cite.state",1)
|
||||||
|
->where("j_article_cite.is_wos",1)
|
||||||
|
->group("j_article.article_id")
|
||||||
|
->order("cite_num desc")
|
||||||
|
->limit(1)
|
||||||
|
->select();
|
||||||
|
|
||||||
|
$list = array_merge($tmr_list,$bmec_list,$mdm_list);
|
||||||
|
$re['list'] = $list;
|
||||||
|
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function getAllCiteArticles(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$rule = new Validate([
|
||||||
|
"limit"=> "require",
|
||||||
|
"page"=>"require"
|
||||||
|
]);
|
||||||
|
if(!$rule->check($data)){
|
||||||
|
return jsonError($rule->getError());
|
||||||
|
}
|
||||||
|
$s_time = strtotime("-3 year");
|
||||||
|
$list = $this->article_obj->field("j_article.*,COUNT(j_article_cite.article_cite_id) as cite_num")
|
||||||
|
->join("j_article_cite","j_article_cite.article_id = j_article.article_id","left")
|
||||||
|
->where("j_article.ctime",">",$s_time)
|
||||||
|
->where("j_article_cite.state",1)
|
||||||
|
->where("j_article_cite.is_wos",1)
|
||||||
|
->group("j_article.article_id")
|
||||||
|
->order("cite_num desc")
|
||||||
|
->page($data['page'],$data['limit'])
|
||||||
|
->select();
|
||||||
|
|
||||||
|
$count = $this->article_obj->field("j_article.*,COUNT(j_article_cite.article_cite_id) as cite_num")
|
||||||
|
->join("j_article_cite","j_article_cite.article_id = j_article.article_id","left")
|
||||||
|
->where("j_article.ctime",">",$s_time)
|
||||||
|
->where("j_article_cite.state",1)
|
||||||
|
->where("j_article_cite.is_wos",1)
|
||||||
|
->group("j_article.article_id")
|
||||||
|
->order("cite_num desc")
|
||||||
|
->count();
|
||||||
|
$re['list'] = strongArticleList($list);
|
||||||
|
$re['count'] = $count;
|
||||||
|
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取3top文章列表
|
* @title 获取3top文章列表
|
||||||
|
|||||||
@@ -232,6 +232,60 @@ function getArticleTracks($doi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getAuthor($article) {
|
||||||
|
$article_author_obj = Db::name("article_author");
|
||||||
|
$where['article_id'] = $article['article_id'];
|
||||||
|
$where['state'] = 0;
|
||||||
|
$list = $article_author_obj->where($where)->select();
|
||||||
|
$frag = '';
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$ca = '';
|
||||||
|
if($v['orcid']!=''){
|
||||||
|
$ca = '<a href="https://orcid.org/'.$v['orcid'].'" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||||
|
}
|
||||||
|
$frag = $frag == '' ? '' . $v['author_name'].$ca : $frag . ', ' . $v['author_name'].$ca;
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
|
function strongArticleList($list){
|
||||||
|
$journal_stage_obj = Db::name("journal_stage");
|
||||||
|
$journal_obj = Db::name("journal");
|
||||||
|
$journals_ltai_obj = Db::name("article_ltai");
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$stage_info = $journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
|
||||||
|
$journal_info = $journal_obj->where('journal_id', $v['journal_id'])->find();
|
||||||
|
//组合cite信息
|
||||||
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$list[$k]['cite'] = $cite;
|
||||||
|
$list[$k]['authortitle'] = getAuthor($v);
|
||||||
|
$list[$k]["mains"] = null;
|
||||||
|
$list[$k]['has_html'] = hasHtml($v['article_id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
//标题斜体
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $journals_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
//连续出版判断,决定是否显示出版时间
|
||||||
|
foreach ($list as $k => $v){
|
||||||
|
$ca_stage = $journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||||
|
if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){
|
||||||
|
$list[$k]['isShowOtime'] = 1;
|
||||||
|
}else{
|
||||||
|
$list[$k]['isShowOtime'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $list;
|
||||||
|
}
|
||||||
|
|
||||||
function choiseJtitle($list)
|
function choiseJtitle($list)
|
||||||
{
|
{
|
||||||
foreach ($list as $k => $v) {
|
foreach ($list as $k => $v) {
|
||||||
|
|||||||
Reference in New Issue
Block a user