This commit is contained in:
wangjinlei
2021-01-14 18:03:29 +08:00
parent 0386c4b02f
commit 51e1fcb18e
2 changed files with 61 additions and 4 deletions

View File

@@ -128,7 +128,7 @@ class Special extends Controller {
->where('j_journal_special_to_editor.state',0)
->select();
foreach ($caches as $val){
$frag = $frag == ''?$val['first_name'].' '.$val['last_name']:','.$val['first_name'].' '.$val['last_name'];
$frag .= $frag == ''?$val['first_name'].' '.$val['last_name']:','.$val['first_name'].' '.$val['last_name'];
}
$list[$k]['editor'] = $frag;
}
@@ -170,7 +170,7 @@ class Special extends Controller {
->where('j_journal_special_to_editor.state',0)
->select();
foreach ($caches as $val){
$frag = $frag == ''?$val['first_name'].' '.$val['last_name']:','.$val['first_name'].' '.$val['last_name'];
$frag .= $frag == ''?$val['first_name'].' '.$val['last_name']:','.$val['first_name'].' '.$val['last_name'];
}
$list[$k]['editor'] = $frag;
}
@@ -180,5 +180,55 @@ class Special extends Controller {
$re['specials'] = $list;
return jsonSuccess($re);
}
/**
* @title 客座期刊(获取客座期刊详情)
* @description 客座期刊(获取客座期刊详情)
* @author wangjinlei
* @url /api/Special/getSpecialDetail
* @method POST
*
* @param name:journal_special_id type:int require:1 desc:客座期刊id
*
* @return keywords:关键字#
* @return journal:期刊信息#
* @return special:客座期刊信息#
* @return editors:编辑array#
*/
public function getSpecialDetail(){
$data = $this->request->post();
$info = $this->journal_special_obj->where('journal_special_id',$data['journal_special_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$info['journal_id'])->find();
$editors = $this->journal_special_to_editor_obj->field('j_journal_special_editor.*')
->join('j_journal_special_editor','j_journal_special_to_editor.journal_special_editor_id = j_journal_special_editor.journal_special_editor_id','LEFT')
->where('j_journal_special_to_editor.journal_special_id',$data['journal_special_id'])
->where('j_journal_special_to_editor.state',0)
->select();
$re['keywords'] = explode(';', $info['keywords']);
$re['journal'] = $journal_info;
$re['special'] = $info;
$re['editors'] = $editors;
return jsonSuccess($re);
}
/**
* @title 客座期刊(获取客座期刊文章)
* @description 客座期刊(获取客座期刊详情)
* @author wangjinlei
* @url /api/Special/getSpecialDetail
* @method POST
*
* @param name:journal_special_id type:int require:1 desc:客座期刊id
*
* @return articles:文章列表array#
*/
public function getSpecialArticles(){
$data = $this->request->post();
$list = $this->article_obj->where('journal_special_id',$data['journal_special_id'])->where('state',0)->select();
$re['articles'] = $list;
return jsonSuccess($re);
}
}