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

试卷做过人数

... ... @@ -193,15 +193,14 @@ class Almighty extends Api
$is_wrong = '1';
}
}
// 记录做过的试卷
// 记录试卷做过人数
$dolog_where = [
'user_id' => $this->auth->id,
'traget_id' => $question['target_id'],
'target_type' => $question['target_type']
];
$dolog = db('mobile_dolog')->where($dolog_where)->find();
$dolog = QuestionAnswer::where($dolog_where)->find();
if(!$dolog){
db('mobile_dolog')->insert($dolog_where);
switch ($question['target_type']){
case '2':
Simulation::where('id',$question['target_id'])->setInc('do_num_real');
... ... @@ -220,6 +219,8 @@ class Almighty extends Api
}
$info->allowField(true)->save([
'question_id' => $question_id,
'target_id' => $question['target_id'],
'target_type' => $question['target_type'],
'user_id' => $this->auth->id,
'content' => $answer,
'is_wrong' => $is_wrong,
... ...