This commit is contained in:
wangjinlei
2022-08-21 15:47:34 +08:00
parent cfac81c806
commit 4dd8910aaa
4 changed files with 141 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ class Journal extends Controller {
protected $subscribe_base_topic_obj = '';
protected $footer_obj = '';
protected $journal_for_author;
protected $journal_for_author_yc_obj = '';
public function __construct(\think\Request $request = null) {
parent::__construct($request);
@@ -64,6 +65,7 @@ class Journal extends Controller {
$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');
$this->journal_for_author_yc_obj = Db::name('journal_for_author_yc');
}
/**
@@ -197,11 +199,12 @@ class Journal extends Controller {
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$noinjfa = $this->journal_for_author_yc_obj->where('journal_id',$data['journal_id'])->column('jfa_id');
$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();
$cache_list = $this->journal_for_author->where('journal_id','in',$journals)->where('jfa_id',"not in",$noinjfa)->where('pid',$v['jfa_id'])->where('jfa_state',0)->order("sort desc")->select();
$list[$k]['children'] = $cache_list;
}
$re['forAuthors'] = $list;