From 4ddb409d7a97e5370e413c5230b0d733faf04070 Mon Sep 17 00:00:00 2001 From: chengxl Date: Tue, 24 Jun 2025 17:27:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/master/controller/Journal.php | 100 +++++++++++++++++----- 1 file changed, 78 insertions(+), 22 deletions(-) diff --git a/application/master/controller/Journal.php b/application/master/controller/Journal.php index cf7122c..6d3151f 100644 --- a/application/master/controller/Journal.php +++ b/application/master/controller/Journal.php @@ -96,24 +96,13 @@ class Journal extends Controller /** * 获取全部期刊 */ - // public function getJournals() - // { - // $jouranls = $this->journal_obj->where('state', 0)->select(); - // $re['journals'] = $jouranls; - // return jsonSuccess($re); - // } public function getJournals() { - //根据条件搜索 - $aParam = $this->request->post(); - $aWhere['state'] = 0; - if(!empty($aParam['issn'])){ - $aWhere['issn'] = ['in',$aParam['issn']]; - } - $jouranls = $this->journal_obj->where($aWhere)->select(); + $jouranls = $this->journal_obj->where('state', 0)->select(); $re['journals'] = $jouranls; return jsonSuccess($re); } + /** * 获取分期通过期刊 */ @@ -249,6 +238,27 @@ class Journal extends Controller return jsonSuccess([]); } + // public function getCiteListForSubmission(){ + // $data = $this->request->post(); + // $rule = new Validate([ + // "issn"=>"require" + // ]); + // if(!$rule->check($data)){ + // return jsonError($rule->getError()); + // } + // $journal_info = $this->journal_obj->where("issn",$data['issn'])->find(); + // $s_time = strtotime(date("Y-m")."-1"); + // $list1 = $this->article_cite_obj + // ->field("j_article.title,j_article.doi,j_article.article_id,j_article_cite.article_cite_id,j_article_cite.factor,j_article_cite.article_name,j_article_cite.doi article_doi,j_article_cite.journal_name,j_article_cite.vol,j_article_cite.is_wos,j_article_cite.is_china") + // ->join("j_article","j_article.article_id = j_article_cite.article_id","left") + // ->where("j_article_cite.journal_id",$journal_info['journal_id']) + // ->where("j_article_cite.state",1) + // ->where("j_article_cite.ctime",">",$s_time) + // ->select(); + // $re['list'] = $list1; + // return jsonSuccess($re); + // } + public function getCiteListForSubmission(){ $data = $this->request->post(); $rule = new Validate([ @@ -259,17 +269,66 @@ class Journal extends Controller } $journal_info = $this->journal_obj->where("issn",$data['issn'])->find(); $s_time = strtotime(date("Y-m")."-1"); + $aWhere = ['journal_id' => $journal_info['journal_id'],'state' => 1,'ctime' => ['>',$s_time]]; $list1 = $this->article_cite_obj - ->field("j_article.title,j_article.doi,j_article.article_id,j_article_cite.article_cite_id,j_article_cite.factor,j_article_cite.article_name,j_article_cite.doi article_doi,j_article_cite.journal_name,j_article_cite.vol,j_article_cite.is_wos,j_article_cite.is_china") - ->join("j_article","j_article.article_id = j_article_cite.article_id","left") - ->where("j_article_cite.journal_id",$journal_info['journal_id']) - ->where("j_article_cite.state",1) - ->where("j_article_cite.ctime",">",$s_time) + ->field("article_cite_id,article_id,factor,article_name,doi article_doi,journal_name,vol,is_wos,is_china,author") + ->where($aWhere) ->select(); + if(!empty($list1)){ + //查询文章信息 + $aArticleId = array_unique(array_column($list1, 'article_id')); + $aWhere = ['article_id' => ['in',$aArticleId]]; + $aArticle = Db::name('article')->field('journal_stage_id,title,doi,article_id,npp')->where($aWhere)->select(); + $aArticle = empty($aArticle) ? [] : array_column($aArticle, null,'article_id'); + $aStageId = empty($aArticle) ? [] : array_unique(array_column($aArticle, 'journal_stage_id')); + if(!empty($aStageId)){ + $aWhere = ['journal_stage_id' => ['in',$aStageId]]; + $aStage = Db::name('journal_stage')->field('journal_stage_id,stage_year,stage_vol,stage_no,journal_id')->where($aWhere)->select(); + $aStage = empty($aStage) ? [] : array_column($aStage, null,'journal_stage_id'); + } + + //数据处理 + foreach ($list1 as $key => $value) { + //文章信息 + $aArticleInfo = empty($aArticle[$value['article_id']]) ? [] : $aArticle[$value['article_id']]; + $list1[$key] += $aArticleInfo; + + //子刊信息 + + $list1[$key]['stage_info'] = ''; + if(!empty($aArticleInfo)){ + $iStageId = $aArticleInfo['journal_stage_id']; + $aStageInfo = empty($aStage[$iStageId]) ? [] : $aStage[$iStageId]; + $list1[$key]['stage_info'] = $this->_cite($aStageInfo,$aArticleInfo); + } + } + } $re['list'] = $list1; return jsonSuccess($re); } + /** + * 处理文章引用 + * @param string $html + * @return string + */ + private function _cite($aJournalStage = [],$aArticle=[]){ + if(empty($aJournalStage)){ + return ''; + } + $no = empty($aJournalStage['stage_no']) ? ':' : '(' . $aJournalStage['stage_no'] . '):'; + $stage_year = empty($aJournalStage['stage_year']) ? '' : $aJournalStage['stage_year']; + $stage_vol = empty($aJournalStage['stage_vol']) ? '' : $aJournalStage['stage_vol']; + + $sCite = ''; + if ($aJournalStage['journal_id'] == 22) { + $sCite = $stage_year . ',' . $stage_vol . $no. $aArticle['npp'] . '. '; + } else { + $sCite = $stage_year . ';' . $stage_vol . $no. $aArticle['npp'] . '.' ; + } + return $sCite; + } + public function getCiteListPForSubmission(){ $data = $this->request->post(); $rule = new Validate([ @@ -352,10 +411,7 @@ class Journal extends Controller // $list3 = $this->article_cite_obj->where("journal_id",$journal['journal_id'])->where("state",1)->where("ctime",">",$y_time)->select(); $y_time = date("Y"); //获取前两年的分期信息 - $y_time_stages = $this->journal_stage_obj - ->where("journal_id",$journal['journal_id']) - ->whereIn("stage_year",[$y_time-1,$y_time-2]) - ->column("journal_stage_id"); + $y_time_stages = $this->journal_stage_obj->where("journal_id",$journal['journal_id'])->whereIn("stage_year",[$y_time-1,$y_time-2])->column("journal_stage_id"); $list3 = $this->article_cite_obj ->field("j_article_cite.*") ->join("j_article","j_article.article_id = j_article_cite.article_id","left") From 47d80a7830b398f3a2eef8c1604c0a7151b4262f Mon Sep 17 00:00:00 2001 From: chengxl Date: Fri, 27 Jun 2025 11:44:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9C=9F=E5=88=8A=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Journal.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index 9d7969e..d47abea 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -142,6 +142,16 @@ class Journal extends Controller { $relatelist = $this->journal_obj->where('journal_id', 'in', $rearr)->where('state', 0)->select(); $absList = $this->journal_abs_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('sort')->select(); $stageList = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('is_publish', 1)->where('state', 0)->order('stage_year desc,stage_no desc')->select(); + + //获取期刊主编辑 chengxiaoling start 20250626 + if(!empty($journal_info)){ + $aBoard = $this->getJournalBoard(['issn' => $journal_info['issn'],'type' => 0]); + $aBoard = empty($aBoard['data']) ? [] : $aBoard['data']; + $sBoard = empty($aBoard) ? '' : implode("
", array_unique(array_column($aBoard, 'realname'))); + $sBoard = trim($sBoard); + $journal_info['editorinchief'] = empty($sBoard) ? $journal_info['editorinchief'] : $sBoard; + } + //获取期刊主编辑 chengxiaoling end 20250626 return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'relats' => $relatelist, 'journalAbs' => $absList, 'journalStage' => $stageList]]); } @@ -1907,4 +1917,19 @@ class Journal extends Controller { $re['count'] = $count; return jsonSuccess($re); } + + /** + * @title 获取期刊编辑 + * @description 获取期刊编辑接口 + */ + private function getJournalBoard($aParam = []){ + $sIssn = empty($aParam['issn']) ? '' : $aParam['issn']; + if(empty($sIssn)){ + return json_encode(['status' => 2,'msg' => 'Parameter is empty']); + } + + $sUrl = "http://api.tmrjournals.com/public/index.php/api/Supplementary/getJournalBoard"; + $aResult = json_decode(myPost($sUrl,$aParam),true); + return $aResult; + } } From 4bee408102e151948f9618a6dde0a4e8ca7bd6d0 Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 2 Jul 2025 15:15:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Supplementary.php | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 application/api/controller/Supplementary.php diff --git a/application/api/controller/Supplementary.php b/application/api/controller/Supplementary.php new file mode 100644 index 0000000..5a6c48a --- /dev/null +++ b/application/api/controller/Supplementary.php @@ -0,0 +1,49 @@ +request->post(); + + //参数验证 + $sIssn = empty($aParam['issn']) ? '' : $aParam['issn']; + if(empty($sIssn)){ + return json_encode(['status' => 2,'msg' => 'Please select an journal']); + } + //期刊标题 + $sTitle = empty($aParam['journal_title']) ? ['About Journal','About us','Journal Information'] : $aParam['journal_title']; + + //根据期刊issn查询期刊ID + $aWhere = ['state' => 0,'issn' => $sIssn]; + $aJournal = Db::name('journal')->field('journal_id')->where($aWhere)->find(); + if(empty($aJournal)){ + return json_encode(['status' => 3,'msg' => 'No journal information found']); + } + //查询期刊编辑信息 + $aWhere = ['state' => 0,'journal_id' => $aJournal['journal_id'],'title' => ['in',$sTitle]]; + $aJournalPaperArt = Db::name('journal_paper_art')->where($aWhere)->column('content'); + return json_encode(['status' => 1,'msg' => 'success','data' => $aJournalPaperArt]); + } + +} +?> \ No newline at end of file