diff --git a/application/api/controller/Special.php b/application/api/controller/Special.php index 5ba5e34..6845897 100644 --- a/application/api/controller/Special.php +++ b/application/api/controller/Special.php @@ -184,8 +184,60 @@ class Special extends Controller { $re['specials'] = $f; return jsonSuccess($re); } - - + /** + * @title 获取客座期刊-新 + * @description 获取客座期刊 + * @author wangjinlei + * @url /api/Special/getSpecials + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + * + * @return specials:客座期刊列表array# + */ + public function getSpecialsNew(){ + + //获取参数 + $data = $this->request->post(); + + //期刊ID + $iJournalId = empty($data['journal_id']) ? 0 : $data['journal_id']; + + //定义返回数组 + $re = ['is_show' => 'false','specials' => [],'count' => 0]; + if(empty($iJournalId)){ + return jsonSuccess($re); + } + //参数组装 + $aWhere = ['state' => 2,'journal_id' => $iJournalId]; + //查询数量 + $iCount = $this->journal_special_obj->where($aWhere)->count(); + if(empty($iCount)){ + return jsonSuccess($re); + } + $re['count'] = $iCount; + //查询期刊详情 + $list = $this->journal_special_obj->where($aWhere)->order('journal_special_id desc')->limit(4)->select(); + $f = []; + //获取作者 + foreach ($list as $k => $v){ + $frag = ''; + $caches = $this->journal_special_to_editor_obj + ->field('j_journal_special_editor.*') + ->join('j_journal_special_editor','j_journal_special_editor.journal_special_editor_id = j_journal_special_to_editor.journal_special_editor_id','LEFT') + ->where('j_journal_special_to_editor.journal_special_id',$v['journal_special_id']) + ->where('j_journal_special_to_editor.state',0) + ->select(); + foreach ($caches as $val){ + $frag .= $frag == ''?$val['first_name'].' '.$val['last_name']:', '.$val['first_name'].' '.$val['last_name']; + } + $v['editor'] = $frag; + $f[] = $v; + } + $re['is_show'] = 'true'; + $re['specials'] = $f; + return jsonSuccess($re); + } /** * @title 获取全部客座期刊 * @description 获取全部客座期刊 diff --git a/application/api/controller/Supplementary.php b/application/api/controller/Supplementary.php index 5a6c48a..1d7b56a 100644 --- a/application/api/controller/Supplementary.php +++ b/application/api/controller/Supplementary.php @@ -31,7 +31,7 @@ class Supplementary extends Controller return json_encode(['status' => 2,'msg' => 'Please select an journal']); } //期刊标题 - $sTitle = empty($aParam['journal_title']) ? ['About Journal','About us','Journal Information'] : $aParam['journal_title']; + $sTitle = empty($aParam['journal_title']) ? ['About Journal','About us','Journal Information','Aims and Scope'] : $aParam['journal_title']; //根据期刊issn查询期刊ID $aWhere = ['state' => 0,'issn' => $sIssn];