From 520713e1d8aa7420fcd91cb9491f2b59ccae0195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Fri, 1 Mar 2019 15:04:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/renshi/controller/Index.php | 10 +++------- application/renshi/model/Teacher.php | 2 +- application/renshi/view/index/edit.html | 8 ++++---- database/seeds/SystemBase.php | 2 +- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index 9b88fba3..7e1218ee 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -124,7 +124,7 @@ class Index extends Base $result = $validate->check($list); $msg = $validate->getError(); - $list['quanpin'] = strtolower($list['quanpin']); + $list['quanpin'] = strtolower(str_replace(' ', '', $list['quanpin'])); $list['shoupin'] = strtolower($list['shoupin']); @@ -187,7 +187,7 @@ class Index extends Base return json(['msg'=>$msg,'val'=>0]);; } - $list['quanpin'] = strtolower($list['quanpin']); + $list['quanpin'] = strtolower(str_replace(' ', '', $list['quanpin'])); $list['shoupin'] = strtolower($list['shoupin']); // 更新数据 $teacher = new Teacher(); @@ -294,7 +294,7 @@ class Index extends Base $teacherlist[$i]['subject'] = srcSubject($value[7]); $teacherlist[$i]['zhuanye'] = $value[9]; $teacherlist[$i]['xueli'] = srcXl($value[10]); - $teacherlist[$i]['quanpin'] = strtolower($value[11]); + $teacherlist[$i]['quanpin'] = strtolower(str_replace(' ', '', $value[11])); $teacherlist[$i]['shoupin'] = strtolower($value[12]); $i++; @@ -355,19 +355,15 @@ class Index extends Base // 声明结果数组 $data = array(); - // 判断是否存在数据,如果没有数据则返回。 if(strlen($str) <= 0) { return json($data); } - // 如果有数据则查询教师信息 $list = Teacher::field('id,xingming,danwei,shengri,sex') ->whereOr('xingming|quanpin|shoupin','like','%'.$str.'%') - // ->whereOr('quanpin','like',$str.'%') - // ->whereOr('shoupin','like',$str.'%') ->append(['age']) ->all(); return json($list); diff --git a/application/renshi/model/Teacher.php b/application/renshi/model/Teacher.php index fa4435b0..ca20f888 100644 --- a/application/renshi/model/Teacher.php +++ b/application/renshi/model/Teacher.php @@ -129,7 +129,7 @@ class Teacher extends Base // 性别获取器 public function getSexAttr($value) { - $sex = array('0'=>'女','1'=>'男','2'=>'保密'); + $sex = array('0'=>'女','1'=>'男','2'=>'未知'); return $sex[$value]; } diff --git a/application/renshi/view/index/edit.html b/application/renshi/view/index/edit.html index 7d0532f6..ffaf779f 100644 --- a/application/renshi/view/index/edit.html +++ b/application/renshi/view/index/edit.html @@ -45,7 +45,7 @@ @@ -59,7 +59,7 @@ @@ -73,7 +73,7 @@ @@ -87,7 +87,7 @@ diff --git a/database/seeds/SystemBase.php b/database/seeds/SystemBase.php index d120c0f6..c3ee1d19 100644 --- a/database/seeds/SystemBase.php +++ b/database/seeds/SystemBase.php @@ -20,7 +20,7 @@ class SystemBase extends Seeder 'update_time' => time(), 'title' => '学生成绩统计系统', 'keywords' => '成绩统计,成绩管理', - 'description' => '这是我们自己开发的系统', + 'description' => '适合我们的才是好用的', 'thinks' => 'H-ui前端框架、ThinkPhp框架', 'danwei' => '大连长兴岛经济区教科培中心', ];