This commit is contained in:
wangjinlei
2020-12-14 11:14:44 +08:00
parent 76e5b272ab
commit 7f4dd55c6b
3 changed files with 58 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ class Journal extends Controller {
protected $journal_stage_obj = '';
protected $journal_notices_obj = '';
protected $journal_abs_obj = '';
protected $journal_cfp_obj = '';
protected $article_to_topic_obj = '';
public function __construct(\think\Request $request = null) {
@@ -32,6 +33,7 @@ class Journal extends Controller {
$this->journal_stage_obj = Db::name('journal_stage');
$this->journal_notices_obj = Db::name('journal_notices');
$this->journal_abs_obj = Db::name('journal_abstracting');
$this->journal_cfp_obj = Db::name('journal_cfp');
$this->article_to_topic_obj = Db::name('article_to_topic');
}
@@ -290,4 +292,23 @@ class Journal extends Controller {
return jsonSuccess($re);
}
/**
* @title 获取期刊cfp
* @description 获取期刊cfp
* @author wangjinlei
* @url /api/Journal/getJournalCfp
* @method POST
*
* @param name:journal_id type:int require:1 desc:期刊id
*
* @return cfps:期刊cfps#
*/
public function getJournalCfp(){
$data = $this->request->post();
$list = $this->journal_cfp_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
$re['cfps'] = $list;
return jsonSuccess($re);
}
}

View File

@@ -73,4 +73,31 @@ class Main extends Controller{
return jsonSuccess($re);
}
/**
* @title 获取首页Highlights
* @description 获取首页Highlights
* @author wangjinlei
* @url /api/Main/getMainhl
* @method POST
*
* @param name:journal_id type:int require:1 desc:期刊id
*
* @return Highlights:array#
*/
public function getMainhl(){
$data = $this->request->post();
$topic_info = $this->journal_topic_obj->where('journal_id',$data['journal_id'])->where('position','highlights')->where('state',0)->find();
if($topic_info){
$list = $this->article_to_topic_obj->field('j_article.*,j_journal_stage.*')
->join(array(['j_article','j_article.article_id = j_article_to_topic.article_id','LEFT'],['j_journal_stage','j_journal_stage.journal_stage_id = j_article.journal_stage_id','LEFT']))
->where('j_article_to_topic.topic_id',$topic_info['journal_topic_id'])
->where('j_article_to_topic.state',0)
->select();
return jsonSuccess(['topic_info'=>$topic_info,'articlelist'=>$list]);
}else{
return jsonError('no highlights');
}
}
}