Ver Fonte

20250228 调整

贾小兵 há 1 mês atrás
pai
commit
0d99e1ac0e

+ 7 - 3
application/admin/controller/teacher/Exams.php

@@ -293,10 +293,14 @@ class Exams extends Backend
         //     ->where($this->whereExtend)->with($this->relationtTable)
         //     ->order($sort, $order)
         //     ->paginate($limit);
-        $sim_type = Db::name('real_exam_collection')->where('exam_collection_id',$ids)->value('sim_type');
+        // $sim_type = Db::name('real_exam_collection')->where('exam_collection_id',$ids)->value('sim_type');
         $list = Db::name('seat')->select();
         foreach ($list as $key => $value) {
-            $sim = Db::name('sim')->where('seat_id',$value['seat_id'])->where('sim_type',$sim_type)->find();
+            $exam = $this->model->where('exam_collection_id',$ids)->order('exam_id desc')->where('seat_id',$value['seat_id'])->find();
+            $sim = Db::name('sim')->where('seat_id',$value['seat_id'])->where('sim_type',$exam['sim_type'])->find();
+
+            $sim_type = $exam['sim_type'];
+
             if($sim_type=='0001'){
                 $sim_type_text = 'FZD04B';
             }else if($sim_type=='0002'){
@@ -319,7 +323,7 @@ class Exams extends Backend
             }else{
                 $sim_state = '';
             }
-            $exam = $this->model->where('exam_collection_id',$ids)->order('exam_id desc')->where('seat_id',$value['seat_id'])->find();
+            
             $user_username = '';
             $user_nickname = '';
             $exam_status = '未登录';

+ 5 - 3
application/admin/controller/teacher/Practice.php

@@ -406,10 +406,12 @@ class Practice extends Backend
             return $this->selectpage();
         }
         [$where, $sort, $order, $offset, $limit] = $this->buildparams();
-        $sim_type = Db::name('real_exam_collection')->where('exam_collection_id',$ids)->value('sim_type');
+        // $sim_type = Db::name('real_exam_collection')->where('exam_collection_id',$ids)->value('sim_type');
         $list = Db::name('seat')->select();
         foreach ($list as $key => $value) {
-            $sim = Db::name('sim')->where('seat_id',$value['seat_id'])->where('sim_type',$sim_type)->find();
+            $exam = $this->model->where('exam_collection_id',$ids)->order('exam_id desc')->where('seat_id',$value['seat_id'])->find();
+            $sim = Db::name('sim')->where('seat_id',$value['seat_id'])->where('sim_type',$exam['sim_type'])->find();
+            $sim_type = $exam['sim_type'];
             if($sim_type=='0001'){
                 $sim_type_text = 'FZD04B';
             }else if($sim_type=='0002'){
@@ -432,7 +434,7 @@ class Practice extends Backend
             }else{
                 $sim_state = '';
             }
-            $exam = $this->exam_model->where('exam_collection_id',$ids)->order('exam_id desc')->where('seat_id',$value['seat_id'])->find();
+            // $exam = $this->exam_model->where('exam_collection_id',$ids)->order('exam_id desc')->where('seat_id',$value['seat_id'])->find();
             $user_username = '';
             $user_nickname = '';
             $exam_status = '未登录';