From ab38653cd766af83c950318013614446b6854d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Fri, 14 Jun 2019 11:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=A6=E7=94=9F=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=90=8C=E6=AD=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/renshi/controller/Student.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/application/renshi/controller/Student.php b/application/renshi/controller/Student.php index dfcdaf47..914e86f0 100644 --- a/application/renshi/controller/Student.php +++ b/application/renshi/controller/Student.php @@ -327,17 +327,24 @@ class Student extends Base intval(substr($value[2],16,1) )% 2 ? $students[$i]['sex'] = 1 :$students[$i]['sex'] = 0 ; $students[$i]['shengri'] = substr($value[2],6,4).'-'.substr($value[2],10,2).'-'.substr($value[2],12,2); $students[$i]['school'] = $list['school']; - $stuid = STU::where('shenfenzhenghao',$value[2])->value('id'); - if($stuid > 0) + $stuid = STU::withTrashed()->where('shenfenzhenghao',$value[2])->find(); + if($stuid) { - $students[$i]['id'] = $stuid; - $students[$i]['delete_time'] = null; - $students[$i]['status'] = true; + if($stuid->delete_time>0) + { + $stuid->restore(); + } + if($stuid->status == 0) + { + $stuid->status = 1; + $stuid->save(); + } + $students[$i]['id'] = $stuid->id; } // 销毁无用变量 $i++; } - + // 实例化学生信息数据模型 $student = new STU();