This commit is contained in:
wangjinlei
2022-02-28 10:01:14 +08:00
parent 4ce4deb4aa
commit bba9cbb937
5 changed files with 112 additions and 26 deletions

View File

@@ -1154,6 +1154,31 @@ class Journal extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
/**
* @title 获取期刊主页分期信息
* @description 获取期刊主页分期信息
* @author wangjinlei
* @url /api/Journal/getMainPageStages
* @method POST
*
* @param name:journal_id type:int require:1 desc:期刊id
*
* @return stages:分期信息#
*/
public function getMainPageStages(){
$data = $this->request->post();
$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;
}
$re['stages'] = $frag;
return jsonSuccess($re);
}
/**
* @title 添加期刊话题订阅(批量)