...
|
...
|
@@ -6,7 +6,9 @@ use think\Db; |
|
|
use app\common\controller\Api;
|
|
|
use app\mobile\model\Question;
|
|
|
use app\mobile\model\Simulation;
|
|
|
use app\mobile\model\Old;
|
|
|
use app\mobile\model\Everyday;
|
|
|
use app\mobile\model\Secret;
|
|
|
use app\mobile\model\QuestionAnswer;
|
|
|
use app\mobile\model\QuestionNote;
|
|
|
use app\mobile\model\QuestionWrong;
|
...
|
...
|
@@ -211,16 +213,13 @@ class Almighty extends Api |
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1599032660",
|
|
|
"time": "1600675472",
|
|
|
"data": {
|
|
|
"total": 1, //题目总数
|
|
|
"list": [{ //题目列表
|
|
|
"id": 1, //题目ID
|
|
|
"title": "测定混凝土立方体抗压强度时,标准试件的尺寸是( )㎜。", //题目
|
|
|
"option": "[{\"name\":\"A\",\"gender\":\"100\\u00d7100\\u00d7100\"},{\"name\":\"B\",\"gender\":\"150\\u00d7150\\u00d7150\"},{\"name\":\"C\",\"gender\":\"200\\u00d7200\\u00d7200\"},{\"name\":\"D\",\"gender\":\"70.7\\u00d770.7\\u00d770.7\"}]", //题目选项
|
|
|
"type": "1", //题目类型:1=单选题,2=多选题,3=判断题,4=简答题
|
|
|
"answer": "A" //答案
|
|
|
}]
|
|
|
"analysis_video": { //解析视频
|
|
|
"cover": "http://qizhibang.brotop.cn/uploads/20200921/Fkp1Dv0c4dyYfVzAFBjhTuv25BNv.mp4?vframe/jpg/offset/1/w/1280/h/720", //封面图
|
|
|
"video": "http://qizhibang.brotop.cn/uploads/20200921/Fkp1Dv0c4dyYfVzAFBjhTuv25BNv.mp4" //视频
|
|
|
},
|
|
|
"analysis_text": "" //解析文字
|
|
|
}
|
|
|
})
|
|
|
*/
|
...
|
...
|
@@ -387,23 +386,32 @@ class Almighty extends Api |
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1599136054",
|
|
|
"time": "1600678092",
|
|
|
"data": {
|
|
|
"1": {
|
|
|
"pan": 0, //判断题数
|
|
|
"banner": "http://www.enterprise.top/uploads/20200911/8894d62100f2f920ffb2f38063b63f2d.jpg", //广告图
|
|
|
"list": [{ // 试卷列表
|
|
|
"0": {
|
|
|
"id": 11,
|
|
|
"target_type": "1",
|
|
|
"target_id": 0,
|
|
|
"type": "3"
|
|
|
},
|
|
|
"pan": 1, //判断题数
|
|
|
"duo": 0, //多选题数
|
|
|
"dan": 2, //单选题数
|
|
|
"title": "测试每日一练", //试卷标题
|
|
|
"id": 1 //试卷ID(全能题库为0)
|
|
|
}
|
|
|
"dan": 0, //单选题数
|
|
|
"title": "《全能题库》", //试卷标题
|
|
|
"type": "1", //题目归属类型:1=全能题库,2=模拟试题,3=历年真题,4=每日一练,5=通关密卷
|
|
|
"id": 0 //试卷ID(全能题库为0)
|
|
|
}]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function wrongQuestion()
|
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$banner = Db::name('mobile_config')->where('id',1)->value('wrong_adver');
|
|
|
$banner = !empty($banner) ? cdnurl($banner,true) : '';
|
|
|
$question_list = Question::alias('q')
|
|
|
->join('mobile_question_answer qa','q.id = qa.question_id and user_id='.$user_id,'left')
|
|
|
->join('mobile_question_answer qa','q.id = qa.question_id and user_id='.$this->auth->id,'left')
|
|
|
->where('qa.is_wrong','1')
|
|
|
->field('q.id,q.target_type,q.target_id,q.type')
|
|
|
->select();
|
...
|
...
|
@@ -432,15 +440,21 @@ class Almighty extends Api |
|
|
$v['title'] = '《全能题库》';
|
|
|
break;
|
|
|
case '2':
|
|
|
case '3':
|
|
|
$v['title'] = Simulation::where('id',$v[0]['target_id'])->value('title');
|
|
|
break;
|
|
|
case '3':
|
|
|
$v['title'] = Old::where('id',$v[0]['target_id'])->value('title');
|
|
|
break;
|
|
|
case '4':
|
|
|
$v['title'] = Everyday::where('id',$v[0]['target_id'])->value('title');
|
|
|
break;
|
|
|
case '5':
|
|
|
$v['title'] = Secret::where('id',$v[0]['target_id'])->value('title');
|
|
|
break;
|
|
|
}
|
|
|
$v['type'] = $v[0]['target_type'];
|
|
|
$v['id'] = $v[0]['target_id'];
|
|
|
}
|
|
|
$this->success('成功',$list);
|
|
|
$this->success('成功',compact('banner','list'));
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|