This commit is contained in:
wangjinlei
2021-05-14 11:00:30 +08:00
parent 90077baf99
commit b79316e8d9
5 changed files with 144 additions and 27 deletions

View File

@@ -35,7 +35,8 @@ class Publish extends Controller{
protected $subscribe_journal_obj = '';
protected $subscribe_topic_obj = '';
protected $super_danger_obj = '';
protected $board_obj = '';
protected $board_group_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -57,6 +58,8 @@ class Publish extends Controller{
$this->subscribe_journal_obj = Db::name('subscribe_journal');
$this->subscribe_topic_obj = Db::name('subscribe_topic');
$this->super_danger_obj = Db::name('super_danger');
$this->board_obj = Db::name('board');
$this->board_group_obj = Db::name('board_group');
}
/**
@@ -193,28 +196,40 @@ class Publish extends Controller{
* @url /super/Publish/getQuality
* @method POST
*
* @param name:start type:string require:1 desc:开始时间
* @param name:end type:string require:1 desc:结束
*
* @return YY:引用数
* @return TGL:投稿量
* @return FWL:发文量
* @return LX:文章类型
* @return GJH:国际化
* @return CK:创刊时间
* @return BW:编委
* @return DY:订阅
*/
public function getQuality(){
$data = $this->request->post();
$journals = $this->journal_obj->where('state',0)->select();
$res = $this->object_to_array(json_decode(myPost(self::AL_URL)));
$start = strtotime($data['start']);
$end = strtotime($data['end'].' 23:59:59');
$pag['start'] = $start;
$pag['end'] = $end;
$res = $this->object_to_array(json_decode(myPost(self::AL_URL,$pag)));
$r = $res['data'];
$tg = [];
foreach ($r as $val){
$tg[$val['issn']] = $val['SJ'];
}
foreach ($journals as $k => $v){
$journals[$k]['YY'] = $this->article_obj->where('journal_id',$v['journal_id'])->where('state',0)->sum('cited');
$journals[$k]['YY'] = $this->article_obj->where('journal_id',$v['journal_id'])->where('ctime','>',$start)->where('ctime','<=',$end)->where('state',0)->sum('cited');
$journals[$k]['TGL'] = isset($tg[$v['issn']])?$tg[$v['issn']]:[];
$journals[$k]['FWL'] = $this->getFWL($v['journal_id']);
$journals[$k]['LX'] = $this->getLX($v['journal_id']);
$journals[$k]['GJH'] = $this->getGJH($v['journal_id']);
$journals[$k]['FWL'] = $this->getFWL($v['journal_id'],$start,$end);
$journals[$k]['LX'] = $this->getLX($v['journal_id'],$start,$end);
$journals[$k]['GJH'] = $this->getGJH($v['journal_id'],$start,$end);
$journals[$k]['CK'] = $this->getCK($v['journal_id']);
$journals[$k]['BW'] = $this->getBW($v['journal_id']);
$journals[$k]['DY'] = $this->subscribe_journal_obj->where('journal_id',$v['journal_id'])->where('state',0)->count();
}
return jsonSuccess($journals);
}
@@ -228,7 +243,7 @@ class Publish extends Controller{
}
/**
* 获取期刊的
* 获取期刊的发文量
*/
private function getFWL($journal_id){
$frag = [];
@@ -247,13 +262,13 @@ class Publish extends Controller{
}
private function getLX($journal_id){
private function getLX($journal_id,$start,$end){
$stages = $this->journal_stage_obj
->where('journal_id',$journal_id)
->where('is_publish',1)
->where('state',0)
->column('journal_stage_id');
$arts = $this->article_obj->where('journal_id',$journal_id)->where('journal_stage_id','in',$stages)->where('state',0)->select();
$arts = $this->article_obj->where('journal_id',$journal_id)->where('ctime','>',$start)->where('ctime','<=',$end)->where('journal_stage_id','in',$stages)->where('state',0)->select();
$frag = [];
foreach ($arts as $v){
if(isset($frag[$v['type']])){
@@ -267,13 +282,13 @@ class Publish extends Controller{
return $frag;
}
private function getGJH($journal_id){
private function getGJH($journal_id,$start,$end){
$stages = $this->journal_stage_obj
->where('journal_id',$journal_id)
->where('is_publish',1)
->where('state',0)
->column('journal_stage_id');
$arts = $this->article_obj->where('journal_id',$journal_id)->where('journal_stage_id','in',$stages)->where('state',0)->column('article_id');
$arts = $this->article_obj->where('journal_id',$journal_id)->where('journal_stage_id','in',$stages)->where('ctime','>',$start)->where('ctime','<=',$end)->where('state',0)->column('article_id');
$auts = $this->article_author_obj->where('article_id','in',$arts)->where('state',0)->select();
$frag = [];
$frag['list'] = [];
@@ -289,6 +304,24 @@ class Publish extends Controller{
return $frag;
}
/**
* 获取编委信息
*/
private function getBW($journal_id){
$list = $this->board_obj->where('journal_id',$journal_id)->where('state',0)->select();
$frag = [];
foreach ($list as $v){
if(isset($frag[$v['country']])){
$frag[$v['country']]++;
}else{
$frag[$v['country']] = 1;
}
}
$re['count'] = count($list);
$re['country'] = $frag;
return $re;
}
/**
* @title 获取历史危险值
* @description 获取历史危险值