diff --git a/application/api/controller/Special.php b/application/api/controller/Special.php index 4163eb5..d741a44 100644 --- a/application/api/controller/Special.php +++ b/application/api/controller/Special.php @@ -128,7 +128,7 @@ class Special extends Controller { ->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']; + $frag .= $frag == ''?$val['first_name'].' '.$val['last_name']:','.$val['first_name'].' '.$val['last_name']; } $list[$k]['editor'] = $frag; } @@ -170,7 +170,7 @@ class Special extends Controller { ->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']; + $frag .= $frag == ''?$val['first_name'].' '.$val['last_name']:','.$val['first_name'].' '.$val['last_name']; } $list[$k]['editor'] = $frag; } @@ -180,5 +180,55 @@ class Special extends Controller { $re['specials'] = $list; return jsonSuccess($re); } + + /** + * @title 客座期刊(获取客座期刊详情) + * @description 客座期刊(获取客座期刊详情) + * @author wangjinlei + * @url /api/Special/getSpecialDetail + * @method POST + * + * @param name:journal_special_id type:int require:1 desc:客座期刊id + * + * @return keywords:关键字# + * @return journal:期刊信息# + * @return special:客座期刊信息# + * @return editors:编辑array# + */ + public function getSpecialDetail(){ + $data = $this->request->post(); + $info = $this->journal_special_obj->where('journal_special_id',$data['journal_special_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id',$info['journal_id'])->find(); + $editors = $this->journal_special_to_editor_obj->field('j_journal_special_editor.*') + ->join('j_journal_special_editor','j_journal_special_to_editor.journal_special_editor_id = j_journal_special_editor.journal_special_editor_id','LEFT') + ->where('j_journal_special_to_editor.journal_special_id',$data['journal_special_id']) + ->where('j_journal_special_to_editor.state',0) + ->select(); + + $re['keywords'] = explode(';', $info['keywords']); + $re['journal'] = $journal_info; + $re['special'] = $info; + $re['editors'] = $editors; + return jsonSuccess($re); + } + + /** + * @title 客座期刊(获取客座期刊文章) + * @description 客座期刊(获取客座期刊详情) + * @author wangjinlei + * @url /api/Special/getSpecialDetail + * @method POST + * + * @param name:journal_special_id type:int require:1 desc:客座期刊id + * + * @return articles:文章列表array# + */ + public function getSpecialArticles(){ + $data = $this->request->post(); + $list = $this->article_obj->where('journal_special_id',$data['journal_special_id'])->where('state',0)->select(); + + $re['articles'] = $list; + return jsonSuccess($re); + } } \ No newline at end of file diff --git a/application/master/controller/Special.php b/application/master/controller/Special.php index 378e90f..a7e40cc 100644 --- a/application/master/controller/Special.php +++ b/application/master/controller/Special.php @@ -242,14 +242,21 @@ class Special extends Controller { * * @param name:journal_id type:int require:1 desc:期刊id * @param name:journal_special_id type:int require:1 desc:客座期刊编辑id + * @param name:pageIndex type:int require:1 desc:当前页码数 + * @param name:pageSize type:int require:1 desc:单页数据条数 * + * @return count:总数 * @return editors:编辑列表array# */ public function getSpecialEditors(){ $data = $this->request->post(); - $cids = $this->journal_special_to_editor_obj->where('journal_special_id',$data['journal_special_id'])->where('state',0)->column('journal_special_editor_id'); - $list = $this->journal_special_editor_obj->where('journal_special_editor_id','not in',$cids)->where('state',0)->select(); + $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; + $cids = $this->journal_special_to_editor_obj->where('journal_special_id',$data['journal_special_id'])->where('state',0)->column('journal_special_editor_id'); + $list = $this->journal_special_editor_obj->where('journal_special_editor_id','not in',$cids)->where('state',0)->limit($limit_start,$data['pageSize'])->select(); + $count = $this->journal_special_editor_obj->where('journal_special_editor_id','not in',$cids)->where('state',0)->count(); + + $re['count'] = $count; $re['editors'] = $list; return jsonSuccess($re); }