Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangjinlei
2025-07-11 15:49:25 +08:00
3 changed files with 152 additions and 22 deletions

View File

@@ -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("<br>", 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;
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace app\api\controller;
use think\Controller;
use think\Db;
/**
* @title 补充接口
* @description 文章接口
*/
class Supplementary extends Controller
{
public function __construct(\think\Request $request = null) {
parent::__construct($request);
}
/**
* @title 获取期刊介绍
* @description 获取期刊编辑接口
*/
public function getJournalPaperArt(){
//获取参数
$aParam = $this->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]);
}
}
?>