From fdd8b59541542ec28fb00ead069a8d51f371d5e4 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Fri, 6 Sep 2024 13:15:07 +0800 Subject: [PATCH] 1 --- application/master/controller/Journal.php | 90 +++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/application/master/controller/Journal.php b/application/master/controller/Journal.php index 54b629f..3d62eb2 100644 --- a/application/master/controller/Journal.php +++ b/application/master/controller/Journal.php @@ -36,6 +36,7 @@ class Journal extends Controller protected $base_topic_obj = ''; protected $subscribe_base_topic_obj = ''; protected $journal_for_author = ''; + protected $article_cite_obj = ''; public function __construct(\think\Request $request = null) { @@ -61,6 +62,7 @@ class Journal extends Controller $this->base_topic_obj = Db::name('base_topic'); $this->subscribe_base_topic_obj = Db::name('subscribe_base_topic'); $this->journal_for_author = Db::name('journal_for_author'); + $this->article_cite_obj = Db::name("article_cite"); } /** @@ -165,6 +167,94 @@ class Journal extends Controller } + public function getCiteDataForSubmission(){ + $data = $this->request->post(); + $rule = new Validate([ + "journals"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $journals = object_to_array(json_decode($data['journals'])); +// $journals = object_to_array(json_decode('[{"issn":"2413-3973","abbr":"TMR","title":"Traditional Medicine Research","editor_id":19,"realname":"\u5218\u5a1c"},{"issn":"2703-173X","abbr":"GHR","title":"Gastroenterology & Hepatology Research","editor_id":19,"realname":"\u5218\u5a1c"},{"issn":"2815-9063","abbr":"BMEC","title":"Biomedical Engineering Communications","editor_id":19,"realname":"\u5218\u5a1c"}]')); + foreach ($journals as $k=>$v){ + $journal = $this->journal_obj->where("issn",$v['issn'])->find(); + $list = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->select(); + $wos_num = 0; + foreach ($list as $val){ + if($val['is_wos']==1){ + $wos_num ++; + } + } + $flag = []; + $flag["num"] = $wos_num."/".count($list); + //本月的引用数 + $s_time = strtotime(date("Y-m")."-1"); + $list1 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->where("ctime",">",$s_time)->select(); + $month_num = 0; + foreach ($list1 as $item) { + if($item['is_wos']==1){ + $month_num++; + } + } + $flag['month_num'] = $month_num."/".count($list1); + //今年引用 +// $y_time = strtotime(date("Y")."-1-1"); +// $list3 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->where("ctime",">",$y_time)->select(); + $y_time = date("Y"); + $list3 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->whereLike("vol","%".$y_time."%")->select(); + $year_num = 0; + foreach ($list3 as $item){ + if($item['is_wos']==1){ + $year_num++; + } + } + $flag['year_num'] = $year_num."/".count($list3); + + //今年发文总量 + $stages = $this->journal_stage_obj->where("journal_id",$journal['journal_id'])->where("stage_year",date("Y"))->column("journal_stage_id"); + $flag['year_aritlce_num'] = $this->article_obj->whereIn("journal_stage_id",$stages)->count(); + + //去年引用 +// $y_s_time = strtotime((date("Y")-1)."-1-1"); +// $y_e_time = strtotime((date("Y")-1)."-12-31"); +// $list2 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->where("ctime",'>',$y_s_time)->where("ctime","<",$y_e_time)->select(); + $y_time = date("Y")-1; + $list2 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->whereLike("vol","%".$y_time."%")->select(); + $pre_year_num = 0; + foreach ($list2 as $item){ + if($item['is_wos']==1){ + $pre_year_num++; + } + } + $flag['pre_year_num'] = $pre_year_num."/".count($list2); + + //去年发文数 + $pre_stages = $this->journal_stage_obj->where("journal_id",$journal['journal_id'])->where("stage_year",date("Y")-1)->column("journal_stage_id"); + $flag["pre_year_article_num"] = $this->article_obj->whereIn("journal_stage_id",$pre_stages)->count(); + + //预测影响因子 + $yz_year = [date("Y")-1,date("Y")-2]; + $stages = $this->journal_stage_obj->where("journal_id",$journal['journal_id'])->whereIn("stage_year",$yz_year)->column("journal_stage_id"); + + $yz_year_list = $this->article_obj->whereIn("journal_stage_id",$stages)->where("type = 'Article' or type = 'Review' or type = 'Mini Review'")->where("state",0)->select(); + $yz_year_list_all = $this->article_obj->whereIn("journal_stage_id",$stages)->where("state",0)->select(); + $article_ids = []; + foreach ($yz_year_list_all as $v){ + $article_ids[] = $v['article_id']; + } + $cite_yz_count = $this->article_cite_obj->whereIn("article_id",$article_ids)->whereLike('vol',"%".date("Y")."%")->where("is_wos",1)->where("state",1)->count(); + + $flag['yc_article_num'] = count($yz_year_list); + $flag['yc_cite_num'] = $cite_yz_count; + $flag['yc_if'] = count($yz_year_list)==0?0:($cite_yz_count*12.5)/(count($yz_year_list)*date("m")); + + $journals[$k]['cite'] = $flag; + } + + return jsonSuccess($journals); + } + /** * @title 添加期刊 * @description 添加期刊