...
|
...
|
@@ -403,7 +403,8 @@ class Index extends Api |
|
|
"study": [{ //学习平台入口
|
|
|
"title": "天津市二级建造师课程", //标题
|
|
|
"image": "http://qizhibang.brotop.cn/uploads/20210127/Fowbl73z1EpqVj0cBILbJL06myDf.png", //图片
|
|
|
"type_id": 3 //科目分类ID
|
|
|
"type_id": 3, //科目分类ID
|
|
|
"is_enter": 1 //是否可进入:0=否,1=是
|
|
|
}],
|
|
|
"class": { //优选课程入口
|
|
|
"title": "2020版一建二建课程" //标题
|
...
|
...
|
@@ -424,6 +425,13 @@ class Index extends Api |
|
|
->select();
|
|
|
foreach ($study as &$v){
|
|
|
$v['image'] = cdnurl($v['image'],true);
|
|
|
$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)
|
|
|
->select();
|
|
|
$v['is_enter'] = count($list) > 0 ? 1 : 0;
|
|
|
}
|
|
|
// 优选课程入口
|
|
|
$class = Db::name('enter_class')->where('id',1)->field('title')->find();
|
...
|
...
|
|