From 66fd54835f96a733c7b0cdc4c59dd4b345761af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Mon, 9 Nov 2020 20:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A6=E6=A0=A1=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/system/controller/School.php | 1 + app/system/model/School.php | 16 ++++++++++------ app/system/view/school/index.html | 8 ++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/system/controller/School.php b/app/system/controller/School.php index 13b0b514..f0ac8253 100644 --- a/app/system/controller/School.php +++ b/app/system/controller/School.php @@ -38,6 +38,7 @@ class School extends AdminBase ,'order' => 'asc' ,'jibie_id' => array() ,'xingzhi_id' => array() + ,'status' => '1' ,'searchval' => '' ],'POST'); diff --git a/app/system/model/School.php b/app/system/model/School.php index 1765bd15..036c92d2 100644 --- a/app/system/model/School.php +++ b/app/system/model/School.php @@ -39,11 +39,12 @@ class School extends BaseModel { // 整理参数 $src = [ - 'jibie_id'=>array(), - 'xingzhi_id'=>array(), - 'xueduan_id'=>array(), - 'kaoshi'=>'', - 'searchval'=>'' + 'jibie_id' => array() + ,'xingzhi_id' => array() + ,'xueduan_id' => array() + ,'kaoshi' => '' + ,'status' => 1 + ,'searchval' => '' ]; $src = array_cover($srcfrom, $src); $src['jibie_id'] = strToArray($src['jibie_id']); @@ -67,6 +68,9 @@ class School extends BaseModel ->when(strlen($src['kaoshi']) > 0, function($query) use($src){ $query->where('kaoshi', $src['kaoshi']); }) + ->when(strlen($src['status']) > 0, function($query) use($src){ + $query->where('status', $src['status']); + }) ->with( [ 'dwXingzhi' => function($query){ @@ -119,7 +123,7 @@ class School extends BaseModel ->field('id, title, jiancheng') ->select(); - return $schlist; + return $schlist; } diff --git a/app/system/view/school/index.html b/app/system/view/school/index.html index 34fa84b9..55452834 100644 --- a/app/system/view/school/index.html +++ b/app/system/view/school/index.html @@ -39,6 +39,14 @@ {/volist} +
+ +
+ + + +
+
{/block} {block name="table"}