作者 何书鹏
1 个管道 的构建 通过 耗费 6 秒

收藏的题目

... ... @@ -1408,9 +1408,11 @@ class User extends Api
"user_id": 16, //用户ID
"question_id": 1, //题目ID
"createtime": "2020.09.03 19:25", //收藏时间
"is_answer": 1, //是否已作答:0=否,1=是
"question": { //题目信息
"title": "测定混凝土立方体抗压强度时,标准试件的尺寸是( )㎜。", //题目
"type": "1" //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
"type": "1", //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
"target_type":"1" //题目归属类型:1=全能题库,2=模拟试题,3=历年真题,4=每日一练,5=通关密卷
}
}]
}
... ... @@ -1423,14 +1425,15 @@ class User extends Api
$data = QuestionCollect::with(['question'])
->alias('a')
->join('mobile_question b','a.question_id = b.id')
->join('mobile_question_answer c','c.question_id = b.id and c.user_id = '.$this->auth->id,'left')
->where('a.user_id',$this->auth->id)
->order('a.createtime desc')
->field('a.*')
->field('a.*,if(c.id > 0,1,0) is_answer')
->paginate($page_num,false,['page'=>$page])
->each(function($v){
$v['createtime'] = date('Y.m.d H:i',$v['createtime']);
if($v->getRelation('question')){
$v->getRelation('question')->visible(['title','type']);
$v->getRelation('question')->visible(['title','type','target_type']);
}
})->toArray();
$this->success('成功', ['total'=>$data['total'],'list'=>$data['data']]);
... ...
... ... @@ -16097,9 +16097,11 @@
"user_id": 16, //用户ID
"question_id": 1, //题目ID
"createtime": "2020.09.03 19:25", //收藏时间
"is_answer": 1, //是否已作答:0=否,1=是
"question": { //题目信息
"title": "测定混凝土立方体抗压强度时,标准试件的尺寸是( )㎜。", //题目
"type": "1" //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
"type": "1", //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
"target_type":"1" //题目归属类型:1=全能题库,2=模拟试题,3=历年真题,4=每日一练,5=通关密卷
}
}]
}
... ... @@ -23080,7 +23082,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2021-01-25 09:52:58 </div>
Generated on 2021-01-25 16:51:12 </div>
<div class="col-md-6" align="right">
<a href="./" target="_blank">企智帮</a>
</div>
... ...