This commit is contained in:
wangjinlei
2022-04-29 16:48:09 +08:00
parent 509fd497ed
commit ea9047b8bd
3 changed files with 285 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ namespace app\api\controller;
use think\Controller;
use think\Db;
use think\Queue;
use think\Validate;
/**
* @title 期刊web接口
@@ -35,6 +36,8 @@ class Journal extends Controller {
protected $board_group_obj = '';
protected $base_topic_obj = '';
protected $subscribe_base_topic_obj = '';
protected $footer_obj = '';
protected $journal_for_author;
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -59,6 +62,8 @@ class Journal extends Controller {
$this->board_group_obj = Db::name('board_group');
$this->base_topic_obj = Db::name('base_topic');
$this->subscribe_base_topic_obj = Db::name('subscribe_base_topic');
$this->footer_obj = Db::name('footer');
$this->journal_for_author = Db::name('journal_for_author');
}
/**
@@ -128,6 +133,84 @@ class Journal extends Controller {
return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'relats' => $relatelist, 'journalAbs' => $absList, 'journalStage' => $stageList]]);
}
/**
* 获取所有底栏文章
*/
public function getAllFooter(){
$where['footer_state'] = 0;
$list = $this->footer_obj->where($where)->order('sort desc')->select();
$frag = [];
$frag['Publishing Policy'] = [];
$frag['Join Us'] = [];
$frag['Products'] = [];
$frag['Cooperate with Us'] = [];
$frag['Publisher Information'] = [];
foreach ($list as $v) {
switch ($v['footer_group']) {
case 1:
$frag['Publishing Policy'][] = $v;
break;
case 2:
$frag['Join Us'][] = $v;
break;
case 3:
$frag['Products'][] = $v;
break;
case 4:
$frag['Cooperate with Us'][] = $v;
break;
case 5:
$frag['Publisher Information'][] = $v;
break;
}
}
$re['footers'] = $frag;
return jsonSuccess($re);
}
/**
* 获取底栏文章详情
*/
public function getFooterAtrNew(){
$data = $this->request->post();
// 验证规则
$rule = new Validate([
'footer_id' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$footer_detail = $this->footer_obj->where('footer_id',$data['footer_id'])->find();
$re['footer'] = $footer_detail;
return jsonSuccess($re);
}
/**
* 获取所有forAuthors
*/
public function getForAuthors(){
$data = $this->request->post();
// 验证规则
$rule = new Validate([
'journal_id' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$journals[]=0;
$journals[]=$data['journal_id'];
$list = $this->journal_for_author->where('journal_id','in',$journals)->where('pid',0)->where('jfa_state',0)->order("sort desc")->select();
foreach($list as $k => $v){
$cache_list = $this->journal_for_author->where('journal_id','in',$journals)->where('pid',$v['jfa_id'])->where('jfa_state',0)->order("sort desc")->select();
$list[$k]['children'] = $cache_list;
}
$re['forAuthors'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取期刊信息通过issn
* @description 获取期刊信息通过issn
@@ -501,6 +584,8 @@ class Journal extends Controller {
return jsonSuccess($re);
}
/**
* @title 获取期刊推广文章
* @description 获取期刊推广文章