From 7a750502d4c07a157d27e99cfa1aaedfc600b2e9 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Fri, 4 Dec 2020 14:58:58 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Journal.php | 49 ++++++++++++++++++++------ 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index ff56212..2a0bae4 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -119,12 +119,13 @@ class Journal extends Controller { * @title 获取期刊推广文章 * @description 获取期刊推广文章 * @author wangjinlei - * @url /api/Journal/getJournalTopic + * @url /api/Journal/getJournalArticles * @method POST * * @param name:journal_id type:int require:1 desc:期刊id * * @return articleList:期刊话题列表array# + * @return stage:当前分期信息array# */ public function getJournalArticles(){ $data = $this->request->post(); @@ -133,16 +134,44 @@ class Journal extends Controller { ->where('state',0) ->order('article_id desc') ->select(); -// $publish_list = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->column('journal_stage_id'); -// $list = $this->article_obj -// ->where('journal_id',$data['journal_id']) -// ->where('state',0) -// ->where('journal_stage_id','in',$publish_list) -// ->order('article_id desc') -// ->limit(10) -// ->select(); - return json(['code'=>0,'msg'=>'success','data'=>['articleList'=>$list]]); + $stage_info = $this->journal_stage_obj->where('journal_stage_id',$journal_info['publish_stage_id'])->find(); + return json(['code'=>0,'msg'=>'success','data'=>['stage'=>$stage_info,'articleList'=>$list]]); } + /** + * @title 获取onlinefirst文章 + * @description 获取onlinefirst文章 + * @author wangjinlei + * @url /api/Journal/getOnlineArticle + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + * + * @return articlelist:文章列表array# + */ + public function getOnlineArticle(){ + $data = $this->request->post(); + $stages = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('is_publish',0)->where('state',0)->column('journal_stage_id'); + $list = $this->article_obj->where('journal_stage_id','in',$stages)->where('state',0)->select(); + return json(['code'=>0,'msg'=>'success','data'=>['articlelist'=>$list]]); + } + + /** + * @title 获取news文章 + * @description 获取news文章 + * @author wangjinlei + * @url /api/Journal/getNewsArticle + * @method POST + * + * @param name:journal_id type:int require:1 desc:期刊id + * + * @return articlelist:文章列表array# + */ + public function getNewsArticle(){ + $data = $this->request->post(); + $stages = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('is_publish',0)->where('state',0)->column('journal_stage_id'); + $list = $this->article_obj->where('journal_stage_id','in',$stages)->where('state',0)->where('type','News','Comment','or')->order('article_id')->select(); + return json(['code'=>0,'msg'=>'success','data'=>['articlelist'=>$list]]); + } }