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

代码bug修改

... ... @@ -495,7 +495,7 @@ class Exam extends Api
->where('user_id',$user_id)
->where('study_id',$study_id)
->where('exam_num',$study_exam_num)
->wherTime('createtime','month')
->whereTime('createtime','month')
->update(['score'=>$score['num']]);
}
}elseif ($type == 2){
... ... @@ -506,7 +506,7 @@ class Exam extends Api
->where('type',2)
->where('question_id',$question_id)
->where('study_exam_num',$study_exam_num)
->wherTime('createtime','month')
->whereTime('createtime','month')
->find();
if(empty($data)){
$this->error('参数有误');
... ... @@ -539,13 +539,13 @@ class Exam extends Api
->where('study_id',$study_id)
->where('study_exam_num',$study_exam_num)
->field('sum(score) as num')
->wherTime('createtime','month')
->whereTime('createtime','month')
->find();
Db::name('third_exam')
->where('user_id',$user_id)
->where('study_id',$study_id)
->where('exam_num',$study_exam_num)
->wherTime('createtime','month')
->whereTime('createtime','month')
->update(['score'=>$score['num']]);
}
}elseif ($type == 3){
... ... @@ -556,7 +556,7 @@ class Exam extends Api
->where('type',3)
->where('question_id',$question_id)
->where('study_exam_num',$study_exam_num)
->wherTime('createtime','month')
->whereTime('createtime','month')
->find();
if(empty($data)){
$this->error('参数有误');
... ... @@ -576,14 +576,14 @@ class Exam extends Api
->where('user_id',$user_id)
->where('study_id',$study_id)
->where('study_exam_num',$study_exam_num)
->wherTime('createtime','month')
->whereTime('createtime','month')
->field('sum(score) as num')
->find();
Db::name('third_exam')
->where('user_id',$user_id)
->where('study_id',$study_id)
->where('exam_num',$study_exam_num)
->wherTime('createtime','month')
->whereTime('createtime','month')
->update(['score'=>$score['num']]);
}
}
... ...
... ... @@ -561,7 +561,7 @@ class User extends Api
$third_exam = Db::name('third_exam')
->where('user_id',$user_id)
->where('study_id',$id)
->wherTime('createtime','month')
->whereTime('createtime','month')
->order('exam_num desc')
->find();
... ...