From 2c0f042659d0943aa60a72026e2bb17267fa5a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Mon, 12 Aug 2019 09:56:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=88=97=E8=A1=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chengji/controller/Index.php | 3 ++- .../chengji/view/index/dw_chengji.html | 2 +- application/chengji/view/index/index.html | 2 +- application/chengji/view/tongji/dw_banji.html | 2 +- application/chengji/view/tongji/tj_banji.html | 2 +- application/chengji/view/tongji/yilu_cnt.html | 2 +- application/common.php | 21 ++++++++++++++++--- application/kaoshi/view/kaohao/biaoqian.html | 2 +- application/kaoshi/view/kaohao/caiji.html | 2 +- application/kaoshi/view/kaohao/index.html | 2 +- 10 files changed, 28 insertions(+), 12 deletions(-) diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index 2927c189..aca1ec92 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -281,7 +281,8 @@ class Index extends Base // 成绩列表 public function index($kaoshi) { - // 设置要给模板赋值的信息 + + // 设置要给模板赋值的信息 $list['webtitle'] = '学生成绩列表'; // 实例化考试数据模型 diff --git a/application/chengji/view/index/dw_chengji.html b/application/chengji/view/index/dw_chengji.html index b24c52e2..0baeeb79 100644 --- a/application/chengji/view/index/dw_chengji.html +++ b/application/chengji/view/index/dw_chengji.html @@ -6,7 +6,7 @@
- {php} $schoollist = schlist('校级','校级');{/php} + {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} {/volist} diff --git a/application/chengji/view/tongji/dw_banji.html b/application/chengji/view/tongji/dw_banji.html index 1ae5e467..7fbcf141 100644 --- a/application/chengji/view/tongji/dw_banji.html +++ b/application/chengji/view/tongji/dw_banji.html @@ -6,7 +6,7 @@
- {php} $schoollist = schlist('校级','校级');{/php} + {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} {/volist} diff --git a/application/chengji/view/tongji/yilu_cnt.html b/application/chengji/view/tongji/yilu_cnt.html index 39ea74b9..e964d419 100644 --- a/application/chengji/view/tongji/yilu_cnt.html +++ b/application/chengji/view/tongji/yilu_cnt.html @@ -16,7 +16,7 @@
- {php} $schoollist = schlist('校级','校级');{/php} + {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} {volist name="schoollist" id="vo"} {/volist} diff --git a/application/common.php b/application/common.php index 59461d52..60f19c6b 100644 --- a/application/common.php +++ b/application/common.php @@ -149,19 +149,34 @@ function excelLieming() // 单位列表 -function schlist($low='班级',$high='其它级') +function schlist($low='班级',$high='其它级',$xueduan=array()) { // 实例化单位模型 $sch = new \app\system\model\School; // 实例化类别数据模型 $cat = new \app\system\model\Category; // 获取获取级别列表 - $catlist = $cat->where('pid',102)->column('title,id'); + $catlist = $cat->where('pid',102) + ->where('status',1) + ->column('title,id'); + + // 获取学段列表 + if(count($xueduan)>0){ + $xdlist = $cat->where('pid',103) + ->where('status',1) + ->where('title','in',$xueduan) + ->column('id'); + }else{ + $xdlist = $cat->where('pid',103) + ->where('status',1) + ->column('id'); + } + // 查询学校 $schlist = $sch->where('jibie','between',[$catlist[$low],$catlist[$high]]) ->where('status',1) - // ->cache('schoollist',180) + ->where('xueduan','in',$xdlist) ->order(['paixu']) ->column('id,title,jiancheng'); diff --git a/application/kaoshi/view/kaohao/biaoqian.html b/application/kaoshi/view/kaohao/biaoqian.html index 0471b4ed..653a7758 100644 --- a/application/kaoshi/view/kaohao/biaoqian.html +++ b/application/kaoshi/view/kaohao/biaoqian.html @@ -16,7 +16,7 @@
- {php} $schoollist = schlist('校级','校级');{/php} + {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} {volist name="schoollist" id="vo"} diff --git a/application/kaoshi/view/kaohao/index.html b/application/kaoshi/view/kaohao/index.html index 496ec259..bdd7900f 100644 --- a/application/kaoshi/view/kaohao/index.html +++ b/application/kaoshi/view/kaohao/index.html @@ -5,7 +5,7 @@
- {php} $schoollist = schlist('校级','校级');{/php} + {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php}