作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

题库功能开发

... ... @@ -126,20 +126,20 @@ class Evaluation extends Backend
if($params['time'] == date('Y-m-d')) {
$subject_list = QuePaperSubject::where('que_paper_id',$params['que_paper_id'])->order('createtime','asc')->select();
$list = [];
foreach ($subject_list as $v) {
foreach ($subject_list as $value) {
$list[] = [
'evaluation_id' => $this->model->id,
'title' => $v['title'],
'text' => $v['text'],
'video_file' => $v['video_file'],
'audio_file' => $v['audio_file'],
'images' => $v['images'],
'option' => $v['option'],
'score' => $v['score'],
'title' => $value['title'],
'text' => $value['text'],
'video_file' => $value['video_file'],
'audio_file' => $value['audio_file'],
'images' => $value['images'],
'option' => $value['option'],
'score' => $value['score'],
];
if(count($list) > 0) {
(new \app\admin\model\EvaluationSubject())->saveAll($list);
}
}
if(count($list) > 0) {
(new \app\admin\model\EvaluationSubject())->saveAll($list);
}
}
Db::commit();
... ...