This commit is contained in:
Administrator
2022-03-22 16:12:45 +08:00
parent 6c1cda1134
commit 05c0a713ee
2 changed files with 18 additions and 7 deletions

View File

@@ -1236,14 +1236,25 @@ class Journal extends Controller {
*/ */
public function getMainPageStages() { public function getMainPageStages() {
$data = $this->request->post(); $data = $this->request->post();
$show_type = $this->journal_obj->where(['journal_id'=> $data['journal_id'],'state'=>0])->value('topic_show_type');
$frag = []; $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($show_type==0){
if (count($list) == 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();
$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(); if (count($list) == 0) {
} else { $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();
$frag = $list; } 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; $re['stages'] = $frag;
return jsonSuccess($re); return jsonSuccess($re);
} }

View File

@@ -386,7 +386,7 @@ class Main extends Controller {
// $push_url = 'http://www.journal.com/api/Main/getImgFile'; // $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){ foreach ($list as $v){
$dir = $root_url."public/".$v."/".date('Ymd'); $dir = $root_url."public/".$v."/".date('Ymd');