diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index 9f9bafa..dbbffa5 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -1236,14 +1236,25 @@ class Journal extends Controller { */ public function getMainPageStages() { $data = $this->request->post(); + $show_type = $this->journal_obj->where(['journal_id'=> $data['journal_id'],'state'=>0])->value('topic_show_type'); $frag = []; - $list = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', date("Y"))->where('is_publish', 1)->where('state', 0)->order("stage_no desc")->select(); - if (count($list) == 0) { - $frag = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', date("Y", strtotime("-1 year")))->where('is_publish', 1)->where('state', 0)->order("stage_no desc")->select(); - } else { - $frag = $list; + if($show_type==0){ + $list = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', date("Y"))->where('is_publish', 1)->where('state', 0)->order("stage_no desc")->select(); + if (count($list) == 0) { + $frag = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', date("Y", strtotime("-1 year")))->where('is_publish', 1)->where('state', 0)->order("stage_no desc")->select(); + } else { + $frag = $list; + } + }else{ + $frag=$this->journal_stage_obj + ->where('journal_id', $data['journal_id']) + ->where('is_publish', 1) + ->where('state', 0) + ->order("stage_year desc,stage_no desc") + ->limit(1,4) + ->select(); } - $re['topic_show_type'] = $this->journal_obj->where(['journal_id'=> $data['journal_id'],'state'=>0])->value('topic_show_type'); + $re['topic_show_type'] = $show_type; $re['stages'] = $frag; return jsonSuccess($re); } diff --git a/application/api/controller/Main.php b/application/api/controller/Main.php index 7f4d2af..0487d3f 100644 --- a/application/api/controller/Main.php +++ b/application/api/controller/Main.php @@ -386,7 +386,7 @@ class Main extends Controller { // $push_url = 'http://www.journal.com/api/Main/getImgFile'; //定义需要查询同化的数组 - $list = ['articleCite','articlePDF','articleicon','articleSUB','boardIcon','articleSUB2','baseTopic','journalCfp','journalfooter','journalicon','journalline','rotation','journaltopic','specialIcon','system','articleCDF']; + $list = ['articleCite','articlePDF','articleicon','articleSUB','boardIcon','articleSUB2','baseTopic','journalCfp','journalstage','journalfooter','journalicon','journalline','rotation','journaltopic','specialIcon','system','articleCDF']; foreach ($list as $v){ $dir = $root_url."public/".$v."/".date('Ymd');