...
|
...
|
@@ -425,11 +425,22 @@ class Index extends Api |
|
|
->select();
|
|
|
foreach ($study as &$v){
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
$where = [
|
|
|
'a.type_id' => $v['type_id'],
|
|
|
'b.third_id' => $this->auth->id
|
|
|
];
|
|
|
$erzi = Db::name('type')->where('id',$v['type_id'])->field('id,pid')->select();
|
|
|
if(!empty($erzi)){
|
|
|
$erzi_id = array_column($erzi,"id");
|
|
|
$sunzi = Db::name('type')->where(['pid'=>['in',$erzi_id]])->field("id")->select();
|
|
|
$sunzi_id = array_column($sunzi,"id");
|
|
|
$son = array_merge($sunzi_id,$erzi_id);
|
|
|
$where['a.type_id'] = ['in',$son];
|
|
|
}
|
|
|
$list = Db::name('study')
|
|
|
->alias('a')
|
|
|
->join('third_study b','b.study_id = a.id')
|
|
|
->where('a.type_id',$v['type_id'])
|
|
|
->where('b.third_id',$this->auth->id)
|
|
|
->where($where)
|
|
|
->select();
|
|
|
$v['is_enter'] = count($list) > 0 ? 1 : 0;
|
|
|
}
|
...
|
...
|
|