获取期刊范围
This commit is contained in:
@@ -34,15 +34,32 @@ class Supplementary extends Controller
|
|||||||
$sTitle = empty($aParam['journal_title']) ? ['About Journal','About us','Journal Information','Aims and Scope'] : $aParam['journal_title'];
|
$sTitle = empty($aParam['journal_title']) ? ['About Journal','About us','Journal Information','Aims and Scope'] : $aParam['journal_title'];
|
||||||
|
|
||||||
//根据期刊issn查询期刊ID
|
//根据期刊issn查询期刊ID
|
||||||
$aWhere = ['state' => 0,'issn' => $sIssn];
|
$aWhere = ['state' => 0,'issn' => ['in',$sIssn]];
|
||||||
$aJournal = Db::name('journal')->field('journal_id')->where($aWhere)->find();
|
$aJournal = Db::name('journal')->where($aWhere)->column('journal_id,issn');
|
||||||
if(empty($aJournal)){
|
if(empty($aJournal)){
|
||||||
return json_encode(['status' => 3,'msg' => 'No journal information found']);
|
return json_encode(['status' => 3,'msg' => 'No journal information found']);
|
||||||
}
|
}
|
||||||
//查询期刊编辑信息
|
//查询期刊编辑信息
|
||||||
$aWhere = ['state' => 0,'journal_id' => $aJournal['journal_id'],'title' => ['in',$sTitle]];
|
$aWhere = ['state' => 0,'journal_id' => ['in',array_keys($aJournal)],'title' => ['in',$sTitle]];
|
||||||
$aJournalPaperArt = Db::name('journal_paper_art')->where($aWhere)->column('content');
|
$aJournalPaperArt = Db::name('journal_paper_art')->field('journal_id,content')->where($aWhere)->select();
|
||||||
return json_encode(['status' => 1,'msg' => 'success','data' => $aJournalPaperArt]);
|
if(empty($aJournalPaperArt)){
|
||||||
|
return json_encode(['status' => 1,'msg' => 'data is null']);
|
||||||
|
}
|
||||||
|
//数据处理
|
||||||
|
$keyword = 'Scope';
|
||||||
|
foreach ($aJournalPaperArt as $key => $value) {
|
||||||
|
|
||||||
|
$sContent = empty($value['content']) ? '' : $value['content'];
|
||||||
|
$sIssn = empty($aJournal[$value['journal_id']]) ? '' : $aJournal[$value['journal_id']];
|
||||||
|
if(empty($sContent) || empty($sIssn)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(stripos($sContent, $keyword) !== false){
|
||||||
|
$aContent[$sIssn] = $sContent;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return json_encode(['status' => 1,'msg' => 'success','data' => empty($aContent) ? [] : $aContent]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user