From 9d5bb59806a28b78db1007acd9d187c68a6bec59 Mon Sep 17 00:00:00 2001 From: cxdbz Date: Tue, 16 Apr 2019 21:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/kaoshi/view/index/create.html | 250 ++++++++---------- application/kaoshi/view/index/index.html | 282 ++++++++++++--------- application/renshi/controller/Student.php | 17 +- application/renshi/model/Student.php | 7 +- application/renshi/view/index/index.html | 8 +- application/renshi/view/student/index.html | 35 ++- 6 files changed, 313 insertions(+), 286 deletions(-) diff --git a/application/kaoshi/view/index/create.html b/application/kaoshi/view/index/create.html index bab9a306..c309e56f 100644 --- a/application/kaoshi/view/index/create.html +++ b/application/kaoshi/view/index/create.html @@ -1,149 +1,111 @@ {extend name="common@create" /} -{block name="formaa"} -
-
- -
- - {php} - $school = schlist('班级','区级'); - {/php} - - -
-
-
- -
- -
-
-
- -
- - {php} - $xq = new app\teach\model\Xueqi; - $xueqi = $xq->where('status',1)->order(['id'=>'desc'])->limit(5)->field('id,title')->select(); - {/php} - - -
-
-
- -
- - {php}$list = getCategory(109);{/php} - - -
-
-
- -
- - ~ - -
-
-
- -
-
{foreach $njlist=nianjilist() as $key=>$vo } - {/foreach} -
-
-
-
- {php} - $subject = new \app\teach\model\Subject; - $sjlist = $subject->where('status',1)->where('id','<=',3)->field('id,title')->order(['paixu'])->select(); - {/php} - -
-
{foreach $sjlist as $key=>$vo } -
- -
- {/foreach} - -
-
-
-
- -
-
-
+{block name="form"} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ {php} $category = getCategory(101);{/php} + +
+
+
+ +
+ {php} $category = getCategory(102);{/php} + +
+
+
+ +
+ {php} $category = getCategory(103);{/php} + +
+
+
+ +
+ +
+
+
+ +
+
{/block} -{block name="yanzheng"} - -{/block} \ No newline at end of file diff --git a/application/kaoshi/view/index/index.html b/application/kaoshi/view/index/index.html index c57932ce..dced5515 100644 --- a/application/kaoshi/view/index/index.html +++ b/application/kaoshi/view/index/index.html @@ -1,133 +1,177 @@ + {extend name="common@list" /} -{block name="topnav"} - +{block name="jsset"} + {/block} -{block name="bouttons"} -
- - - - - 批量删除 - - - - - 添加考试 - - - - 共有数据:{$list.count} 条 - +{block name="nav"} + + 考试管理 + 考试列表 + +{/block} +{block name="search"} + {/block} -{block name="tables"} - - - - - - - - - - - - - - - - -
标题分类参考年级参考学科开始时间结束时间状态操作
- - +{block name="table"} +
{/block} {block name="myjs"} - + + + + {/block} \ No newline at end of file diff --git a/application/renshi/controller/Student.php b/application/renshi/controller/Student.php index 5d409894..8528d1b1 100644 --- a/application/renshi/controller/Student.php +++ b/application/renshi/controller/Student.php @@ -39,11 +39,24 @@ class Student extends Base 'field'=>'update_time', 'order'=>'asc', 'school'=>array(), - 'nianji'=>array(), - 'banji'=>array(), + 'ruxuenian'=>array(), + 'paixu'=>array(), 'searchval'=>'' ],'POST'); + $ruxuenian = $src['ruxuenian']; + $paixu = $src['paixu']; + + // 实例化班级数据模型 + $banji = new \app\teach\model\Banji; + $src['banji'] = $banji->where('status',1) + ->when(count($ruxuenian)>0,function($query) use($ruxuenian){ + $query->where('ruxuenian','in',$ruxuenian); + }) + ->when(count($paixu)>0,function($query) use($paixu){ + $query->where('paixu','in',$paixu); + }) + ->column('id'); // 实例化 $stu = new STU; diff --git a/application/renshi/model/Student.php b/application/renshi/model/Student.php index 740df35e..52518c33 100644 --- a/application/renshi/model/Student.php +++ b/application/renshi/model/Student.php @@ -62,12 +62,13 @@ class Student extends Base ->when(count($school)>0,function($query) use($school){ $query->where('school','in',$school); }) - ->when(count($banji)>0,function($query) use($banji){ - $query->where('banji','in',$banji); - }) + // ->when(count($banji)>0,function($query) use($banji){ + // $query->where('banji','in',$banji); + // }) ->when(strlen($searchval)>0,function($query) use($searchval){ $query->where('xingming','like','%'.$searchval.'%')->field('id'); }) + ->where('banji','in',$banji) ->with([ 'stuSchool'=>function($query){ $query->field('id,title'); diff --git a/application/renshi/view/index/index.html b/application/renshi/view/index/index.html index d805687c..55a6f44a 100644 --- a/application/renshi/view/index/index.html +++ b/application/renshi/view/index/index.html @@ -21,16 +21,16 @@ autocomplete="off" class="layui-input">
-
- +
+
{php} $schoollist = schlist('校级','校级');{/php} {volist name="schoollist" id="vo"} - + {/volist}
-
+
{php} $category = getCategory(107);{/php} diff --git a/application/renshi/view/student/index.html b/application/renshi/view/student/index.html index 85f8a6bf..e6471939 100644 --- a/application/renshi/view/student/index.html +++ b/application/renshi/view/student/index.html @@ -23,31 +23,38 @@ autocomplete="off" class="layui-input">
-
- +
+
{php} $schoollist = schlist('校级','校级');{/php} {volist name="schoollist" id="vo"} - + {/volist}
-
- +
+
- {php} $category = getCategory(107);{/php} - {volist name="category" id="vo"} - - {/volist} + {php} $njlist = nianjiList();{/php} + {foreach $njlist as $key=>$vo} + + {/foreach}
- +
- {php} $category = getCategory(105);{/php} - {volist name="category" id="vo"} - - {/volist} + {php} + $banji = new \app\teach\model\Banji; + $ruxuenian = array_keys($njlist); + $paixu = $banji->where('status',1) + ->where('ruxuenian','in',$ruxuenian) + ->max('paixu'); + $bjlist = banjinamelist(); + {/php} + {for start="1" end="$paixu+1" } + + {/for}