From 674827ca3fecc1731a0bcc943c8b3e852c1430b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Sun, 9 Aug 2020 21:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=88=90=E7=BB=A9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/model/TongjiBj.php | 1 + app/kaohao/controller/Index.php | 4 +- app/kaohao/model/SearchCanYu.php | 31 +- app/kaohao/model/SearchOne.php | 49 +- app/kaoshi/view/index/more_action.html | 7 + app/student/view/chengji/read.html | 11 + app/studentSearchChengji/controller/Index.php | 39 +- app/studentSearchChengji/route/student.php | 9 +- .../view/index/index.html | 469 ++++++++---------- app/tools/controller/KsCanyu.php | 1 - app/tools/controller/OneStudentChengji.php | 3 +- app/tools/model/OneStudentChengji.php | 4 +- .../migrations/20200106013922_tongji_bj.php | 1 + 13 files changed, 296 insertions(+), 333 deletions(-) diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 68907ba0..d5d047b7 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -340,6 +340,7 @@ class TongjiBj extends BaseModel ->where('banji_id', $src['banji_id']) ->where('kaoshi_id', 'in', function ($query) use ($src) { $query->name('kaoshi') + ->where('luru&status', '0') ->whereTime('bfdate|enddate', 'between', [$src['bfdate'], $src['enddate']]) ->when(count($src['xueqi_id']) > 0, function($q) use ($src) { $q->where('xueqi_id', 'in', function($w) use ($src) { diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index 5fc8e6be..aeeb26d9 100644 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -76,8 +76,8 @@ class Index extends AdminBase ]); // 获取参加考试年级数组 - $bfdate = KS::where('id', $list['kaoshi_id'])->value('bfdate'); - $njlist = nianJiNameList($bfdate); + $enddate = KS::where('id', $list['kaoshi_id'])->value('enddate'); + $njlist = nianJiNameList('str', $enddate); // 重新组合学生信息 $kaohao = array(); foreach ($stulist as $key => $value) { diff --git a/app/kaohao/model/SearchCanYu.php b/app/kaohao/model/SearchCanYu.php index f7f9ecb6..95cce61f 100644 --- a/app/kaohao/model/SearchCanYu.php +++ b/app/kaohao/model/SearchCanYu.php @@ -23,27 +23,26 @@ class SearchCanyu extends BaseModel $kh = new kh; $schoolList = $kh->where('kaoshi_id', $src['kaoshi_id']) - ->when(count($src['ruxuenian']) > 0, function($query) use($src){ - $query->where('ruxuenian', 'in', $src['ruxuenian']); - }) - ->with(['cjSchool' => function($query){ - $query->field('id, jiancheng, paixu, title') - ->order(['paixu' => 'asc']); - } - ]) - ->group('school_id') - ->field('school_id') - ->select() - ->toArray(); + ->when(count($src['ruxuenian']) > 0, function($query) use($src){ + $query->where('ruxuenian', 'in', $src['ruxuenian']); + }) + ->with(['cjSchool' => function($query){ + $query->field('id, jiancheng, paixu, title') + ->order(['paixu' => 'asc']); + } + ]) + ->group('school_id') + ->field('school_id') + ->select(); // 重新整理参加学校信息 $data = array(); foreach ($schoolList as $key => $value) { $data[] = [ - 'paixu' => $value['cjSchool']['paixu'], - 'id' => $value['cjSchool']['id'], - 'title' => $value['cjSchool']['title'], - 'jiancheng' => $value['cjSchool']['jiancheng'], + 'paixu' => $value->cjSchool->paixu, + 'id' => $value->cjSchool->id, + 'title' => $value->cjSchool->title, + 'jiancheng' => $value->cjSchool->jiancheng, ]; } diff --git a/app/kaohao/model/SearchOne.php b/app/kaohao/model/SearchOne.php index 69c293b3..65245500 100644 --- a/app/kaohao/model/SearchOne.php +++ b/app/kaohao/model/SearchOne.php @@ -15,10 +15,11 @@ class SearchOne extends BaseModel { // 初始化参数 $src = array( - 'student_id' => '', - 'category_id' => '', - 'xueqi_id' => '', - 'kaoshi_id' => '', + 'student_id' => '' + ,'category_id' => '' + ,'xueqi_id' => '' + ,'kaoshi_id' => '' + ,'searchval' => '' ); $src = array_cover($srcfrom, $src); $src['category_id'] = strToArray($src['category_id']); @@ -41,30 +42,26 @@ class SearchOne extends BaseModel $kh = new kh; $stuCj = $kh->where('student_id',$src['student_id']) - ->when(count($src['category_id'])>0, function($query) use($src){ - $query->where('kaoshi_id','in',function($q) use($src){ - $q->name('kaoshi') - ->where('category_id','in',$src['category_id']) - ->field('id'); - }); - }) - ->when(count($src['xueqi_id'])>0, function($query) use($src){ - $query->where('kaoshi_id','in',function($q) use($src){ - $q->name('kaoshi') - ->where('xueqi_id','in',function($w) use($src){ - $w->name('xueqi') - ->where('category_id','in',$src['xueqi_id']) - ->field('id'); - }) - ->field('id'); - }); - }) - ->when(count($src['kaoshi_id'])>0, function($query) use($src){ - $query->where('kaoshi_id', 'in', $src['kaoshi_id']); - }) ->where('kaoshi_id', 'in', function($query) use($src){ $query->name('kaoshi') - ->whereTime('bfdate|enddate', 'between', [ $src['bfdate'],$src['enddate'] ]) + ->whereTime('bfdate|enddate', 'between', [$src['bfdate'], $src['enddate']]) + ->where('luru&status', '0') + ->when(count($src['kaoshi_id'])>0, function($w) use($src){ + $w->where('id', 'in', $src['kaoshi_id']); + }) + ->when(strlen($src['searchval'])>0, function($w) use($src){ + $w->where('title', 'like', '%' . $src['searchval'] . '%'); + }) + ->when(count($src['category_id'])>0, function($w) use($src){ + $w->where('category_id', 'in', $src['category_id']); + }) + ->when(count($src['xueqi_id'])>0, function($w) use($src){ + $w->where('xueqi_id', 'in', function($q) use($src){ + $q->name('xueqi') + ->where('category_id', 'in', $src['xueqi_id']) + ->field('id'); + }); + }) ->field('id'); }) ->with([ diff --git a/app/kaoshi/view/index/more_action.html b/app/kaoshi/view/index/more_action.html index b1a67455..87c8cf92 100644 --- a/app/kaoshi/view/index/more_action.html +++ b/app/kaoshi/view/index/more_action.html @@ -61,6 +61,13 @@
生成考号
+ +
+ +
任课教师
+
+
diff --git a/app/student/view/chengji/read.html b/app/student/view/chengji/read.html index 661b6a5b..1aa37c18 100644 --- a/app/student/view/chengji/read.html +++ b/app/student/view/chengji/read.html @@ -149,6 +149,17 @@ } }); + // 监听表单提交 + form.on('submit(srcsubmit)', function(data){ + options.where = lForm.val("search"); + table.render(options); //获取数据并渲染 + for(x in xk) + { + getDefenlv(xk[x].id,xk[x].lieming,xk[x].title); + } + return false; + }); + // 添加图表中内容 for(x in xk) diff --git a/app/studentSearchChengji/controller/Index.php b/app/studentSearchChengji/controller/Index.php index af06e6e2..232aab0c 100644 --- a/app/studentSearchChengji/controller/Index.php +++ b/app/studentSearchChengji/controller/Index.php @@ -29,20 +29,6 @@ class Index extends StudentSearchBase // 设置要给模板赋值的信息 $list['webtitle'] = config('shangma.webtitle'); # 系统名称 - $kh = new \app\kaohao\model\Kaohao; - $khInfo = $kh->where('student_id',session('student.userid')) - ->order(['kaoshi_id'=>'desc']) - ->with([ - 'cjKaoshi' => function ($query) { - $query->field('id,title,bfdate,enddate'); - } - ]) - ->find(); - $list['id'] = $khInfo->id; - // $list['id'] = 9480; - $list['kaoshi_title'] = $khInfo->cjKaoshi->title; - $list['kaoshi_date'] = $khInfo->cjKaoshi->bfdate . '~' . $khInfo->cjKaoshi->enddate; - $stu = new \app\student\model\Student; $stuInfo = $stu->where('id', session('student.userid')) ->with([ @@ -56,6 +42,7 @@ class Index extends StudentSearchBase $list['xingming'] = $stuInfo->xingming; $list['banjiTitle'] = $stuInfo->stuBanji->banjiTitle; $list['student_id'] = session('student.userid'); + $list['sbj'] = subjectKaoshiList(); // 模板赋值 $this->view->assign('list', $list); @@ -64,6 +51,28 @@ class Index extends StudentSearchBase } + + // 学生查询页首页 + public function read($kaohao_id) + { + $kh = new \app\kaohao\model\Kaohao; + $khInfo = $kh->where('id', $kaohao_id) + ->with([ + 'cjKaoshi' => function ($query) { + $query->field('id, title, bfdate, enddate'); + } + ]) + ->find(); + $list['webtitle'] = $khInfo->cjKaoshi->title; + $list['id'] = $khInfo->id; + + // 模板赋值 + $this->view->assign('list', $list); + + return $this->view->fetch('kaohao@index/read'); + } + + // 修改密码 public function editpassword() { @@ -84,7 +93,7 @@ class Index extends StudentSearchBase // 保存新密码 - public function updatePassword($id) + public function updatePassword($student_id) { // 获取表单数据 $list = request()->post(); diff --git a/app/studentSearchChengji/route/student.php b/app/studentSearchChengji/route/student.php index ae1b72de..eb86e443 100644 --- a/app/studentSearchChengji/route/student.php +++ b/app/studentSearchChengji/route/student.php @@ -13,13 +13,8 @@ use think\facade\Route; // 学生管理 Route::group('index', function () { Route::rule('index','Index/index','get'); # 信息列表 - // Route::rule('yibiao','Index/ajaxOneStudentChengjiYiBiao','post'); # 信息列表 - // Route::rule('leida','Index/ajaxOneStudentChengjiLeiDa','post'); # 信息列表 - // Route::rule('xkcj','Index/ajaxOneStudentSubjectChengji','post'); # 信息列表 - // Route::rule('xkdfl','Index/ajaxOneStudentSubjectDefenlv','post'); # 信息列表 - // Route::rule('xkwz','Index/ajaxOneStudentSubjectWeizhi','post'); # 信息列表 - // Route::rule('oldcj','Index/ajaxOneStudentOldChengji','post'); # 信息列表 + Route::rule('read/', 'Index/read', 'get'); # 读取信息 Route::rule('editpassword','Index/editpassword','get'); # 信息列表 - Route::rule('updatepassword/','Index/updatePassword','put'); # 信息列表 + Route::rule('updatepassword/','Index/updatePassword','put'); # 信息列表 }); diff --git a/app/studentSearchChengji/view/index/index.html b/app/studentSearchChengji/view/index/index.html index 50ab156a..17e6c994 100644 --- a/app/studentSearchChengji/view/index/index.html +++ b/app/studentSearchChengji/view/index/index.html @@ -78,67 +78,75 @@ 退了
- {if ( session('student.password') == 123) } + {if (session('student.password') == 123) }
您现在使用的是默认密码,为了您的信息不被漏,请及时修改密码。
{/if} -
-
- {$list.kaoshi_title}考试成绩({$list.kaoshi_date}) -
-
-
-
-
- 各学科总分 -
-
-
-
+
+
+
+
+

筛选

+
+
+
-
-
-
- 各学科得分 -
-
-
-
+
+ +
+ + {php} $category = categoryChildren(108);{/php} + {volist name="category" id="vo"} + + {/volist} +
-
-
-
-
- 各学科得分率 -
-
-
-
+
+ +
+ {php} $category = categoryChildren(109);{/php} + {volist name="category" id="vo"} + + {/volist} +
-
-
-
-
- 各学科成绩与平均分对比 +
+
+ +
+
-
-
+
+
+
-
-
-
-
- 各学科成绩位置 -
-
-
-
+ +
+
+
+
+
+
+
+
+ {volist name="$list.sbj" id="vo"} +
+ {/volist}

@@ -150,23 +158,29 @@
+ diff --git a/app/tools/controller/KsCanyu.php b/app/tools/controller/KsCanyu.php index 124d053f..476dd452 100644 --- a/app/tools/controller/KsCanyu.php +++ b/app/tools/controller/KsCanyu.php @@ -21,7 +21,6 @@ class KsCanYu extends BaseController $cy = new \app\kaohao\model\SearchCanYu; $school = $cy->school($src); - // $school = $ksset->srcGrade($kaoshi_id); $school = reSetArray($school, $src); return json($school); diff --git a/app/tools/controller/OneStudentChengji.php b/app/tools/controller/OneStudentChengji.php index 3cd9e065..6be72ed1 100644 --- a/app/tools/controller/OneStudentChengji.php +++ b/app/tools/controller/OneStudentChengji.php @@ -28,9 +28,9 @@ class OneStudentChengji extends BaseController ,'xueqi_id' => '' ,'bfdate' => '' ,'enddate' => '' + ,'searchval' => '' ], 'POST'); - // 获取学生成绩 $stucj = new STUCJ; $khList = $stucj->oldList($src); @@ -138,6 +138,7 @@ class OneStudentChengji extends BaseController ,'xueqi_id' => '' ,'bfdate' => '' ,'enddate' => '' + ,'searchval' => '' ], 'POST'); $stucj = new STUCJ; diff --git a/app/tools/model/OneStudentChengji.php b/app/tools/model/OneStudentChengji.php index ed13550f..9bb10892 100644 --- a/app/tools/model/OneStudentChengji.php +++ b/app/tools/model/OneStudentChengji.php @@ -21,6 +21,7 @@ class OneStudentChengji extends BaseModel ,'xueqi_id' => '' ,'bfdate' => '' ,'enddate' => '' + ,'searchval' => '' ); $src = array_cover($srcfrom, $src); @@ -99,8 +100,9 @@ class OneStudentChengji extends BaseModel ,'xueqi_id' => '' ,'bfdate' => '' ,'enddate' => '' + ,'searchval' => '' ); - $src = array_cover( $srcfrom , $src ); + $src = array_cover($srcfrom, $src); $one = new \app\kaohao\model\SearchOne; $stuCj = $one->oldChengji($src); diff --git a/database/migrations/20200106013922_tongji_bj.php b/database/migrations/20200106013922_tongji_bj.php index 33648218..4ffc0d0a 100644 --- a/database/migrations/20200106013922_tongji_bj.php +++ b/database/migrations/20200106013922_tongji_bj.php @@ -34,6 +34,7 @@ class TongjiBj extends Migrator // 添加当前表字段 $table ->addColumn('kaoshi_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'考试']) + ->addColumn('teacher_id','integer',['limit'=>11,'null'=>true,'comment'=>'任课教师']) ->addColumn('banji_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'班级']) ->addColumn('subject_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) ->addColumn('stu_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'参加考试人数'])