diff --git a/application/chengji/controller/Tongji.php b/application/chengji/controller/Tongji.php index 7fa4406c..75f1740d 100644 --- a/application/chengji/controller/Tongji.php +++ b/application/chengji/controller/Tongji.php @@ -119,21 +119,22 @@ class Tongji extends Base public function ajaxSchool() { // 获取年级和班级列表名 - $njnames = nianjiList(); + // $njnames = nianjiList(); // 获取表单参数 $getParam = request()->param(); - $school = $getParam['school']; + $nianji = $getParam['nianji']; // 实例化成绩数据模型 - $cj = new \app\chengji\model\Chengji; + $cj = new \app\system\model\Chengji; // 根据考试号和年级获取考试成绩 - $cjlist = $cj->searchNianji($getParam['kaoshiid'],$school,$getParam['ruxuenian']); + $cjlist = $cj->searchNianji($kaoshi=$getParam['kaoshiid'],$nianji=$getParam['ruxuenian']); - // 根据年级获取一个有多少个班级 - $bj = new \app\teach\model\Banji; - $bjids = $bj->where('ruxuenian',$getParam['ruxuenian']) + // 获取学校列表 + + $sch = new \app\teach\model\School; + $schids = $sch->where('ruxuenian',$getParam['ruxuenian']) ->when(!empty($school),function($query) use($school){ $query->where('school','in',$school); }) @@ -174,4 +175,12 @@ class Tongji extends Base return json($data); } + + + public function test() + { + $aa = schlist('区级','区级'); + dump($aa); + } + } diff --git a/application/chengji/model/Chengji.php b/application/chengji/model/Chengji.php index 77f73e48..e54c6ab4 100644 --- a/application/chengji/model/Chengji.php +++ b/application/chengji/model/Chengji.php @@ -138,6 +138,8 @@ class Chengji extends Base + + // 根据考试ID查询所有考试成绩 public function searchAll($kaoshiid) { @@ -162,6 +164,8 @@ class Chengji extends Base } + + // 考试项目查询范围 public function scopeKaoshi($query,$kaoshiid) { diff --git a/application/chengji/view/index/chengjilist.html b/application/chengji/view/index/chengjilist.html index f1d48ea3..796f463f 100644 --- a/application/chengji/view/index/chengjilist.html +++ b/application/chengji/view/index/chengjilist.html @@ -35,8 +35,7 @@
{php} - $school = new app\system\model\School; - $school = $school->searchMany('校级','校级'); + $school = schlist('校级','校级'); {/php}
diff --git a/application/chengji/view/index/download.html b/application/chengji/view/index/download.html index ffdfccf4..e6c0306f 100644 --- a/application/chengji/view/index/download.html +++ b/application/chengji/view/index/download.html @@ -29,9 +29,9 @@
- {php} $school = new app\system\model\School; $school = $school->where('jibie','>',1)->field('id,title')->all();{/php} + {php} $school = schlist('校级','校级');{/php} - + {volist name="school" id="vo"} {/volist} diff --git a/application/chengji/view/tongji/tjnianji.html b/application/chengji/view/tongji/tjnianji.html index b9dc672b..b438a99b 100644 --- a/application/chengji/view/tongji/tjnianji.html +++ b/application/chengji/view/tongji/tjnianji.html @@ -18,9 +18,9 @@
{php} - $school = new app\system\model\School; - $school = $school->searchMany('校级','校级'); - {/php} + $school = schlist('校级','校级'); + {/php} +
{foreach $school as $key=>$vo } diff --git a/application/chengji/view/tongji/tjschool.html b/application/chengji/view/tongji/tjschool.html index b9dc672b..0bc9da3b 100644 --- a/application/chengji/view/tongji/tjschool.html +++ b/application/chengji/view/tongji/tjschool.html @@ -16,22 +16,6 @@
筛选
-
- {php} - $school = new app\system\model\School; - $school = $school->searchMany('校级','校级'); - {/php} -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
{php} $njlist = nianjiList(); @@ -91,16 +75,6 @@ type: "post", data: { kaoshiid:"{$list.kaoshi}", - school:function(){ - var chk = []; - $('input[name="school"]:checked').each(function(){ - if(typeof($(this).val()) != "undefined") - { - chk.push($(this).val()); - } - }); - return chk; - }, ruxuenian:function(){ var a = $('input:radio:checked').val(); // if(typeof(a) == "undefined") diff --git a/application/common.php b/application/common.php index 46fee364..922b4c92 100644 --- a/application/common.php +++ b/application/common.php @@ -135,3 +135,23 @@ function excelLieming() $liemingarr = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']; return $liemingarr; } + + + +// 单位列表 +function schlist($low='班级',$high='其它级') +{ + // 实例化单位模型 + $sch = new \app\system\model\School; + // 实例化类别数据模型 + $cat = new \app\system\model\Category; + // 获取获取级别列表 + $catlist = $cat->where('pid',102)->column('title,id'); + + // 查询学校 + $schlist = $sch->where('jibie','between',[$catlist[$low],$catlist[$high]]) + // ->cache('schoollist',180) + ->column('id,title,jiancheng'); + + return $schlist; +} \ No newline at end of file diff --git a/application/kaoshi/view/index/create.html b/application/kaoshi/view/index/create.html index a5c6df73..d449eaa6 100644 --- a/application/kaoshi/view/index/create.html +++ b/application/kaoshi/view/index/create.html @@ -6,8 +6,7 @@
{php} - $school = new app\system\model\School; - $school = $school->where('status',1)->field('id,title')->all(); + $school = schlist('班级','区级'); {/php} diff --git a/application/kaoshi/view/more_action/biaoqian.html b/application/kaoshi/view/more_action/biaoqian.html index 524ec39e..b41a98d7 100644 --- a/application/kaoshi/view/more_action/biaoqian.html +++ b/application/kaoshi/view/more_action/biaoqian.html @@ -29,9 +29,9 @@
- {php} $school = new app\system\model\School; $school = $school->where('jibie','>',1)->field('id,title')->all();{/php} + {php} $school = schlist('校级','校级');{/php} diff --git a/application/kaoshi/view/more_action/kaohao.html b/application/kaoshi/view/more_action/kaohao.html index 1cfb9e6d..ed21ac03 100644 --- a/application/kaoshi/view/more_action/kaohao.html +++ b/application/kaoshi/view/more_action/kaohao.html @@ -6,8 +6,7 @@
{php} - $school = new app\system\model\School; - $school = $school->where('status',1)->field('id,title')->all(); + $school = schlist('校级','校级'); {/php} - {volist name="list" id="vo"} + {volist name="school" id="vo"} {/volist} diff --git a/application/renshi/view/index/edit.html b/application/renshi/view/index/edit.html index 6646d032..bde7167e 100644 --- a/application/renshi/view/index/edit.html +++ b/application/renshi/view/index/edit.html @@ -41,10 +41,10 @@
- {php} $school = new app\system\model\School; $category = $school->where('jibie','>',1)->field('id,title,jiancheng')->all();{/php} + {php} $school = schlist('校级','区级');{/php} diff --git a/application/renshi/view/student/create.html b/application/renshi/view/student/create.html index 0d6bad93..68579819 100644 --- a/application/renshi/view/student/create.html +++ b/application/renshi/view/student/create.html @@ -40,9 +40,9 @@
- {php} $school = new app\system\model\School; $school = $school->where('jibie','>',1)->field('id,title')->all();{/php} + {php} $school = schlist('校级','校级');{/php} - + {volist name="school" id="vo"} {/volist} diff --git a/application/renshi/view/student/index.html b/application/renshi/view/student/index.html index 7853d2de..1cf257b9 100644 --- a/application/renshi/view/student/index.html +++ b/application/renshi/view/student/index.html @@ -39,8 +39,7 @@
{php} - $school = new app\system\model\School; - $school = $school->searchMany('校级','校级'); + $school = schlist('校级','校级'); {/php}
diff --git a/application/system/model/School.php b/application/system/model/School.php index c123ef51..e3b910e7 100644 --- a/application/system/model/School.php +++ b/application/system/model/School.php @@ -78,19 +78,19 @@ class School extends Base } // 查询范围内数据 - public function searchMany($jibie1,$jibie2) - { - $jb = new \app\system\model\Category; - $jibie1 = $jb->wherePid(102) - ->whereTitle($jibie1) - ->value('id'); - $jibie2 = $jb->wherePid(102) - ->whereTitle($jibie2) - ->value('id'); + // public function searchMany($jibie1,$jibie2) + // { + // $jb = new \app\system\model\Category; + // $jibie1 = $jb->wherePid(102) + // ->whereTitle($jibie1) + // ->value('id'); + // $jibie2 = $jb->wherePid(102) + // ->whereTitle($jibie2) + // ->value('id'); - $schlist = $this->where('jibie','between',[$jibie1,$jibie2])->select(); - return $schlist; - } + // $schlist = $this->where('jibie','between',[$jibie1,$jibie2])->select(); + // return $schlist; + // } diff --git a/application/teach/view/banji/create.html b/application/teach/view/banji/create.html index d0b7724e..4384fc65 100644 --- a/application/teach/view/banji/create.html +++ b/application/teach/view/banji/create.html @@ -6,8 +6,7 @@
{php} - $school = new app\system\model\School; - $school = $school->where('status',1)->field('id,title')->all(); + $school = schlist('校级','校级'); {/php} -
-
-
- -
- -
-
-
- -
- - {php}$category = getCategory(108);{/php} - - -
-
-
- -
- - ~ - -
-
-
-
- -
-
- -{/block} -{block name="yanzheng"} - -{/block} \ No newline at end of file