diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index 1ae36af..82dce31 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -544,9 +544,32 @@ class Journal extends Controller ->select(); $list = $journals; } + //获取期刊主编辑 chengxiaoling start 20251210 + if(!empty($list) && is_array($list)){ + $aIssn = array_unique(array_column($list, 'issn')); + if (!empty($aIssn)) { + $sIssn = implode(',',$aIssn); + $aBoard = $this->getJournalBoard(['issn' => $sIssn, 'type' => 0]); + $aBoard = empty($aBoard['data']) ? [] : $aBoard['data']; + } + } + //获取期刊主编辑 chengxiaoling end 20251210 foreach ($list as $k => $v) { $abs = $this->journal_abs_obj->where('journal_id', $v['journal_id'])->where('state', 0)->order('sort')->limit(4)->select(); $list[$k]['abs'] = $abs; + //获取期刊主编辑 chengxiaoling start 20251210 + $sIssn = empty($v['issn']) ? '' : $v['issn']; + $sBoard = ''; + if(!empty($sIssn) && !empty($aBoard[$sIssn])){ + if(is_array($aBoard[$sIssn])){ + $sBoard = implode("
", array_unique($aBoard[$sIssn])); + }elseif(is_string($aBoard[$sIssn])){ + $sBoard = $aBoard[$sIssn]; + } + } + $editorinchief = empty($v['editorinchief']) ? '' : $v['editorinchief']; + $list[$k]['editorinchief'] = empty($sBoard) ? $editorinchief : $sBoard; + //获取期刊主编辑 chengxiaoling end 20251210 } $re['journals'] = $list; return jsonSuccess($re); @@ -682,7 +705,12 @@ class Journal extends Controller public function getAuthorFB() { $data = $this->request->post(); - $stages = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', '>', (intval(date('Y')) - 3))->where('state', 0)->column('journal_stage_id'); + //修改获取近三年的期刊数据不包括当前年 20260106 start + // $stages = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', '>', (intval(date('Y')) - 3))->where('state', 0)->column('journal_stage_id'); + $iNowYear = date('Y');//当前年份 + $iThreeYear = intval($iNowYear - 3);//过去三年 + $stages = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', '>=', $iThreeYear)->where('stage_year', '<', $iNowYear)->where('state', 0)->column('journal_stage_id'); + //修改获取近三年的期刊数据不包括当前年 20260106 end $articles = $this->article_obj->where('journal_id', $data['journal_id'])->where('journal_stage_id', 'in', $stages)->where('state', 0)->column('article_id'); $list = $this->article_author_obj->where('article_id', 'in', $articles)->where('state', 0)->select(); $frag = []; @@ -773,13 +801,13 @@ class Journal extends Controller // ->where('j_article.state', 0) // ->where('j_article.is_public',1) // ->order('j_journal_stage.stage_year desc,j_article.sort desc') -// ->limit($limit_start, $data['pageSize'])->select(); +// ->limit($limit_start, $data['pageSize'])->select(); // $count = $this->article_obj // ->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT') // ->where('j_article.journal_stage_id', 'in', $stages) // ->where('j_article.state', 0) // ->where('j_article.is_public',1) -// ->count(); +// ->count(); $list = $this->article_obj ->field('j_article.*,j_journal_stage.*') // ->field("j_article.article_id,j_article.journal_id,j_article.npp,j_article.type,j_article.abstract,j_article.abs_num,j_article.html_num,j_article.doi,j_article.journal_stage_id,j_article.title,j_article.icon,j_article.abbr,j_journal_stage.stage_year")