diff --git a/app/BaseController.php b/app/BaseController.php index 1960ea9b..6fb354c8 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -8,6 +8,7 @@ use think\exception\ValidateException; use think\Validate; use app\middleware\UserLogin; use app\middleware\Auth; +use app\middleware\Online; /** @@ -15,7 +16,6 @@ use app\middleware\Auth; */ abstract class BaseController { - /** * Request实例 * @var \think\Request @@ -40,7 +40,9 @@ abstract class BaseController * @var array */ protected $middleware = [ - 'login','auth' + 'auth' + ,'login' + ]; /** diff --git a/app/StudentSearchBase.php b/app/StudentSearchBase.php new file mode 100644 index 00000000..052cdfc2 --- /dev/null +++ b/app/StudentSearchBase.php @@ -0,0 +1,19 @@ +where('id', $id) @@ -314,7 +314,7 @@ class Index extends BaseController 'webtitle' => '修改密码' ,'butname' => '修改' ,'formpost' => 'PUT' - ,'url' => '/admin/index/updatepassword/' . session('userid') + ,'url' => '/admin/index/updatepassword/' . session('admin.userid') ); // 模板赋值 diff --git a/app/chengji/common.php b/app/chengji/common.php index e388c51c..3b8a600b 100644 --- a/app/chengji/common.php +++ b/app/chengji/common.php @@ -30,11 +30,11 @@ function manfenvalidate($defen, $manfen) return $data; } - if ( ($defen*10)%5 != 0 ) { - $data['val'] = 0; - $data['msg'] = '得分必须只能是x.5'; - return $data; - } + // if ( ($defen*10)%5 != 0 ) { + // $data['val'] = 0; + // $data['msg'] = '得分必须只能是x.5'; + // return $data; + // } return $data; } diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index bba785d9..03840b24 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -420,6 +420,7 @@ class Bjtongji extends BaseController ,'school_id' => array() ,'banji_id' => array() ,'subject_id' => '' + ,'cishu' => 20 ], 'POST'); if (count($src['banji_id']) == 0) { diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 0062bb81..04606b45 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -17,14 +17,15 @@ class Index extends BaseController // 获取参加考试的年级和学科 $ksset = new \app\kaoshi\model\KaoshiSet; $list['set']['nianji'] = $ksset->srcNianji($kaoshi_id); - $list['set']['subject_id'] = $ksset->srcSubject($kaoshi_id); + $src['kaohao_id'] = $kaoshi_id; + $list['set']['subject_id'] = $ksset->srcSubject($src); if (count($list['set']['nianji']) > 0) { $src['ruxuenian']=$list['set']['nianji'][0]; } else { $src['ruxuenian']=array(); } $src['kaoshi_id'] = $kaoshi_id; - $khSrc = new \app\kaohao\model\Search; + $khSrc = new \app\kaohao\model\SearchMore; $list['set']['school_id'] = $khSrc->cySchool($src); $list['kaoshi_id'] = $kaoshi_id; $list['dataurl'] = '/chengji/index/data'; @@ -54,7 +55,7 @@ class Index extends BaseController // 获取参与考试的班级 if (count($src['banji_id']) == 0) { - $khSrc = new \app\kaohao\model\Search; + $khSrc = new \app\kaohao\model\SearchMore; $src['banji_id']= array_column($khSrc->cyBanji($src), 'id'); } diff --git a/app/chengji/controller/Luru.php b/app/chengji/controller/Luru.php index 882d4109..2ae193c7 100644 --- a/app/chengji/controller/Luru.php +++ b/app/chengji/controller/Luru.php @@ -129,7 +129,7 @@ class Luru extends BaseController $data = [ 'kaohao_id' => $list['kaohao_id'] ,'subject_id' => $list['subject_id'] - ,'user_id' => session('userid') + ,'user_id' => session('admin.userid') ,'defen' => $list['defen'] ,'defenlv' => $list['defen'] / $manfen * 100 ]; @@ -198,13 +198,13 @@ class Luru extends BaseController $cjone->defen = $list['newdefen']; $cjone->defenlv = $list['newdefen'] / $manfen * 100; - $cjone->user_id = session('userid'); + $cjone->user_id = session('admin.userid'); $data = $cjone->save(); } else { $data = [ 'kaohao_id' => $list['kaohao_id'] ,'subject_id' => $subject_id - ,'user_id' => session('userid') + ,'user_id' => session('admin.userid') ,'defen' => $list['newdefen'] ,'defenlv' => $list['newdefen'] / $manfen * 100 ]; @@ -309,7 +309,7 @@ class Luru extends BaseController } } - $user_id = session('userid'); # 获取用户id + $user_id = session('admin.userid'); # 获取用户id $data = array(); // 重新组合数组 diff --git a/app/chengji/model/Chengji.php b/app/chengji/model/Chengji.php index 4f6a717c..c5c08673 100644 --- a/app/chengji/model/Chengji.php +++ b/app/chengji/model/Chengji.php @@ -3,10 +3,10 @@ namespace app\chengji\model; // 引用基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; -class Chengji extends BaseModel +class Chengji extends KaoshiBase { // 学科关联 public function subjectName() @@ -135,7 +135,7 @@ class Chengji extends BaseModel $src = array_cover($srcfrom, $src); // 实例化考号数据模型 - $khSrc = new \app\kaohao\model\Search; + $khSrc = new \app\kaohao\model\SearchMore; $chengjilist = $khSrc->srcChengjiList($src); return $chengjilist; diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php index f306b1a6..4aa6312c 100644 --- a/app/chengji/model/Tongji.php +++ b/app/chengji/model/Tongji.php @@ -3,9 +3,9 @@ namespace app\chengji\model; // 引用基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; -class Tongji extends BaseModel +class Tongji extends KaoshiBase { // 统计成绩 public function tongjiCnt($cj = array(), $subject_id) @@ -303,11 +303,16 @@ class Tongji extends BaseModel // 根据给定数据统计分数段 - public function fenshuduan($arr = array(), $manfen = 0) + public function fenshuduan($arr = array(), $manfen = 0, $cishu = 30) { + $cishu == '' ? $cishu = 20 : true; // 计算分数段 - $fenshuduan = array(); - $long = 5; + $long = round($manfen / $cishu, 3); + $fenshuduan[] = [ + 'low' => '-'.$long + ,'high' => 0 + ,'cnt' => 0 + ]; $cnt = 0; for($i = 0; $i <= $manfen; $i=$i+$long) { @@ -320,9 +325,13 @@ class Tongji extends BaseModel foreach ($arr as $key => $value) { $xiabiao = intval($value / $long); + if($xiabiao < 0){ + $fenshuduan[0]['cnt'] = $fenshuduan[0]['cnt'] + 1; + continue; + } if (isset($fenshuduan[$xiabiao])) { - $fenshuduan[$xiabiao]['cnt'] = $fenshuduan[$xiabiao]['cnt'] + 1; + $fenshuduan[$xiabiao + 1]['cnt'] = $fenshuduan[$xiabiao + 1]['cnt'] + 1; $cnt = $cnt + 1; } } diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 6bc53355..71940bee 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -2,7 +2,7 @@ namespace app\chengji\model; // 引用基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; // 引用学生成绩统计类 use app\chengji\model\Tongji as TJ; @@ -10,7 +10,7 @@ use app\chengji\model\Tongji as TJ; /** * @mixin think\Model */ -class TongjiBj extends BaseModel +class TongjiBj extends KaoshiBase { // 统计参加本次考试所有班级的成绩并保存 public function tjBanji($kaoshi_id) @@ -163,6 +163,7 @@ class TongjiBj extends BaseModel ,'banji_id' => array() ,'ruxuenian' => '' ,'subject_id' => '' + ,'cishu' => 20 ); $src = array_cover($srcfrom, $src); @@ -196,8 +197,7 @@ class TongjiBj extends BaseModel }); if (count($cjcol) > 0) { - - $data = $tj->fenshuduan($cjcol, $fsx); + $data = $tj->fenshuduan($cjcol, $fsx, $src['cishu']); } } diff --git a/app/chengji/model/TongjiNj.php b/app/chengji/model/TongjiNj.php index b7e7b576..3d68c72a 100644 --- a/app/chengji/model/TongjiNj.php +++ b/app/chengji/model/TongjiNj.php @@ -1,14 +1,14 @@ ['规则1','规则2'...] - * - * @var array - */ - protected $rule = []; - - /** - * 定义错误信息 - * 格式:'字段名.规则名' => '错误信息' - * - * @var array - */ - protected $message = []; -} diff --git a/app/chengji/view/bjtongji/fenshuduan.html b/app/chengji/view/bjtongji/fenshuduan.html index 7daa101b..ff2cd959 100644 --- a/app/chengji/view/bjtongji/fenshuduan.html +++ b/app/chengji/view/bjtongji/fenshuduan.html @@ -14,6 +14,15 @@ {/block} {block name="search"} +
+ +
+ +
+
@@ -81,7 +90,7 @@ // 添加班级 addBanji(); - loadTubiao() + loadTubiao(); // 监听表单提交 form.on('radio', function(data){ @@ -90,6 +99,15 @@ $("#srcsubmit").click(); }); + $('#searchval').on("keydown", function(e){ + var e = e || window.event; + if(e.keyCode == 13){ + loadTubiao(); + return false; + } + return true; + }) + // 监听表单提交 form.on('checkbox', function(data){ checkall = $(data.elem).attr('checkall'); diff --git a/app/common.php b/app/common.php index e51bcafa..2b61af50 100644 --- a/app/common.php +++ b/app/common.php @@ -289,29 +289,7 @@ return $covered; } - - // /** - // * 根据考试ID值,判断考试开始或者结束时间是否已过 - // * $kaoshiid 考试ID - // * $str 统计项目 - // * 返回 $data - // * */ - // function kaoShiDate($kaoshiid, $str='enddate') - // { - // $ks = new app\kaoshi\model\Kaoshi; - // $enddate = $ks->where('id', $kaoshiid) - // ->value($str); - - // $thistime = time(); - // if( $thistime > $enddate ) - // { - // $data = true; - // }else{ - // $data = false; - // } - // return $data; - // } - + /** * 获取参加考试的学科 diff --git a/app/facade/Ck.php b/app/facade/Ck.php new file mode 100644 index 00000000..f2ae93e9 --- /dev/null +++ b/app/facade/Ck.php @@ -0,0 +1,12 @@ +srcSubject($srcfrom); + if(count($ksSubject)==0) + { + return $data = array(); + } + $xk = array(); + foreach ($ksSubject as $key => $value) { + $xk[$value['id']] = $value['lieming']; + } + return $xk; + } +} diff --git a/app/formattools/controller/Index.php b/app/formattools/controller/Index.php new file mode 100644 index 00000000..06eb72a9 --- /dev/null +++ b/app/formattools/controller/Index.php @@ -0,0 +1,18 @@ + $value) { + $array[$value->subjectName->lieming] = $value; + unset($array[$key]); + } + return $array; + } +} diff --git a/app/formattools/controller/OnLine.php b/app/formattools/controller/OnLine.php new file mode 100644 index 00000000..c57fb092 --- /dev/null +++ b/app/formattools/controller/OnLine.php @@ -0,0 +1,21 @@ +isAjax(); + if($isajax) + { + $this->error($msg, '/login/err'); + }else{ + echo ""; + } + return true; + } +} diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index c20cc241..ff8e312b 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -18,9 +18,9 @@ class Index extends BaseController $list['webtitle'] = config('shangma.webtitle'); # 系统名称 $list['version'] = config('shangma.version'); # 版本号 $ad = new \app\admin\model\Admin; # 获取用户姓名 - $list->xingming = $ad->where('id', session('userid'))->value('xingming'); + $list->xingming = $ad->where('id', session('admin.userid'))->value('xingming'); $auth = new \app\admin\model\AuthRule; # 菜单 - $menu = $auth->menu(session('userid')); + $menu = $auth->menu(session('admin.userid')); $list['menu'] = $menu; // 模版赋值 @@ -44,14 +44,14 @@ class Index extends BaseController ->find(); // 查询用户登信息 - $list['username'] = session('username'); + $list['username'] = session('admin.username'); $list['webtitle'] = config('shangma.webtitle'); // 查询用户姓名及用户拥有的权限 $admin = new \app\admin\model\Admin; - $list['xingming'] = $admin->where('id',session('userid')) + $list['xingming'] = $admin->where('id',session('admin.userid')) ->value('xingming'); - $list['group'] = $admin->getGroupnames(session('userid')); + $list['group'] = $admin->getGroupnames(session('admin.userid')); $list['server'] = request()->server(); // 获取系统版本号 diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index e37cf8d4..2ef1f706 100644 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -219,32 +219,20 @@ class Index extends BaseController // 学生信息 public function read($id) { - $list['webtitle'] ='成绩'; - $list['dataurl'] = '/student/studentcj/chengjilist'; - $list['id'] = $id; + $kh = new \app\kaohao\model\Kaohao; + $khInfo = $kh->where('id', $id) + ->with([ + 'cjKaoshi' => function ($query) { + $query->field('id, title, bfdate, enddate'); + } + ]) + ->find(); + $list['webtitle'] = $khInfo->cjKaoshi->title; + $list['id'] = $khInfo->id; - $stucj = new \app\kaohao\model\Search; - $defen = $stucj->khSrcChengji($id); - $color = [ - 'layui-bg-red' - ,'layui-bg-orange' - ,'layui-bg-green' - ,'layui-bg-cyan' - ,'layui-bg-blue' - ,'layui-bg-black' - ]; - - foreach ($defen->ksChengji as $key => $value) { - $list['cj'][$value->subject_id]['defen'] = $value->defen * 1; - $list['cj'][$value->subject_id]['defenlv'] = $value->defenlv * 1; - $list['cj'][$value->subject_id]['bweizhi'] = round($value->bweizhi, 0) .'%'; - $list['cj'][$value->subject_id]['title'] = $value->subjectName->title; - $list['cj'][$value->subject_id]['color'] = $color[$key % 5]; - } - - // // 模板赋值 + // 模板赋值 $this->view->assign('list', $list); - // 渲染模板 + return $this->view->fetch(); } diff --git a/app/kaohao/model/Kaohao.php b/app/kaohao/model/Kaohao.php index 07cab3ea..4767c53b 100644 --- a/app/kaohao/model/Kaohao.php +++ b/app/kaohao/model/Kaohao.php @@ -3,65 +3,10 @@ namespace app\kaohao\model; // 引用数据模型基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; -class Kaohao extends BaseModel +class Kaohao extends KaoshiBase { - // 列出成绩原始数据,其它数据模型中的方法以此方法为基础进行数据整理 - public function search($srcfrom) - { - // 初始化参数 - $src = array( - 'kaoshi_id' => '0' - ,'banji_id' => array() - ,'searchval' => '' - ); - - // 用新值替换初始值 - $src = array_cover($srcfrom, $src) ; - $src['banji_id'] = strToarray($src['banji_id']); - - // 查询成绩 - $data = $this->where('kaoshi_id', $src['kaoshi_id']) - ->field('id, school_id, student_id, ruxuenian, paixu, kaoshi_id, nianji') - ->where('banji_id', 'in', $src['banji_id']) - ->when(strlen($src['searchval']) > 0, function($query) use($src){ - $query->where(function($w) use ($src){ - $w - ->whereOr('student_id', 'in', function($q)use($src){ - $q->name('student') - ->where('xingming', 'like', '%' . $src['searchval'] . '%') - ->field('id'); - }); - }); - }) - ->with([ - 'ksChengji' => function($query){ - $query->field('id, kaohao_id, subject_id, defen, bweizhi, xweizhi, qweizhi') - ->with([ - 'subjectName' => function ($q) { - $q->field('id, title, jiancheng, lieming'); - } - ]); - } - ,'cjSchool' => function($query){ - $query->field('id, jiancheng'); - } - ,'cjStudent' => function($query){ - $query->field('id, xingming, sex'); - } - ]) - ->append(['banjiTitle', 'banTitle']) - ->select(); - - foreach ($data as $key => $value) { - $data[$key]->ksChengji = $this->zzcj($value->ksChengji); - } - - return $data; - } - - // 班级成绩关联 public function banjiKaohao() { @@ -120,19 +65,6 @@ class Kaohao extends BaseModel $title = $bj[$this->getAttr('paixu')]; return $title; } - - - // 转置成绩数组 - private function zzcj($array = array()) - { - $arr = array(); - foreach ($array as $key => $value) { - $array[$value->subjectName->lieming] = $value; - unset($array[$key]); - } - return $array; - } - } diff --git a/app/kaohao/model/Search.php b/app/kaohao/model/SearchMore.php similarity index 87% rename from app/kaohao/model/Search.php rename to app/kaohao/model/SearchMore.php index dc288363..7216bc82 100644 --- a/app/kaohao/model/Search.php +++ b/app/kaohao/model/SearchMore.php @@ -3,14 +3,68 @@ namespace app\kaohao\model; // 引用数据模型基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; // 引用数据模型 use \app\kaohao\model\Kaohao as kh; -class Search extends BaseModel +class SearchMore extends KaoshiBase { - // 查询学生各学科成绩详细信息 + /* + * 以班级为单位,列出本次考试成绩原始数据; + * 其它数据以此方法为基础进行数据整理 + */ + public function search($srcfrom) + { + // 初始化参数 + $src = array( + 'kaoshi_id' => '0' + ,'banji_id' => array() + ,'searchval' => '' + ); + + // 用新值替换初始值 + $src = array_cover($srcfrom, $src) ; + $src['banji_id'] = strToarray($src['banji_id']); + + // 查询成绩 + $kh = new kh(); + $data = $kh->where('kaoshi_id', $src['kaoshi_id']) + ->field('id, school_id, student_id, ruxuenian, paixu, kaoshi_id, nianji') + ->where('banji_id', 'in', $src['banji_id']) + ->when(strlen($src['searchval']) > 0, function($query) use($src){ + $query->where(function($w) use ($src){ + $w + ->whereOr('student_id', 'in', function($q)use($src){ + $q->name('student') + ->where('xingming', 'like', '%' . $src['searchval'] . '%') + ->field('id'); + }); + }); + }) + ->with([ + 'ksChengji' => function($query){ + $query->field('id, kaohao_id, subject_id, defen, bweizhi, xweizhi, qweizhi') + ->with([ + 'subjectName' => function ($q) { + $q->field('id, title, jiancheng, lieming'); + } + ]); + } + ,'cjSchool' => function($query){ + $query->field('id, jiancheng'); + } + ,'cjStudent' => function($query){ + $query->field('id, xingming, sex'); + } + ]) + ->append(['banjiTitle', 'banTitle']) + ->select(); + return $data; + } + + + // 查询本次考试学生各学科成绩详细信息 public function srcChengjiList($srcfrom) { // 初始化参数 @@ -22,24 +76,14 @@ class Search extends BaseModel // 用新值替换初始值 $src = array_cover($srcfrom, $src); - $kh = new kh; - $khlist = $kh->search($src); + $khlist = $this->search($src); if($khlist->isEmpty()) { return $data = array(); } - // 获取参考学科 - $ksset = new \app\kaoshi\model\KaoshiSet; - $ksSubject = $ksset->srcSubject($src['kaoshi_id'], '', ''); - if(count($ksSubject)==0) - { - return $data = array(); - } - $xk = array(); - foreach ($ksSubject as $key => $value) { - $xk[$value['id']] = $value['lieming']; - } + $zl = new \app\zhengli\controller\CanKao; + $xk = $zl->cankaoSubjectIdAndLieming($src); // 实例化学生数据模型 $stu = new \app\student\model\Student; @@ -94,7 +138,7 @@ class Search extends BaseModel } - // 查询各班级考号,并以班级进行分组 + // 查询本次考试各班级考号,并以班级进行分组 public function srcBanjiKaohao($srcfrom) { // 初始化参数 @@ -185,7 +229,7 @@ class Search extends BaseModel // 获取单个学生历次考试成绩 - public function srcOneStudentChengji($srcfrom) + public function srcOneStudentOldChengji($srcfrom) { // 初始化参数 $src = array( @@ -270,7 +314,7 @@ class Search extends BaseModel // 根据考号查询成绩 - public function khSrcChengji($id) + public function oneKaohaoChengji($id) { $kh = new kh; $stuCj = $kh::where('id', $id) diff --git a/app/kaohao/view/index/read.html b/app/kaohao/view/index/read.html index c9bc0a7e..106fe837 100644 --- a/app/kaohao/view/index/read.html +++ b/app/kaohao/view/index/read.html @@ -9,6 +9,7 @@ {load href="__XADMIN__/css/font.css" /} {load href="__XADMIN__/css/xadmin.css" /} {load href="__XADMIN__/js/jquery.min.js" /} + {load href="__STATIC__/mayi/css/studentSearch.css" /} {load href="__XADMIN__/lib/layui/layui.js" /} {load href="__XADMIN__/js/xadmin.js" /} {load href="__XADMIN__/js/cookie.js" /} @@ -17,98 +18,115 @@ {$list.webtitle} -
-
-
-
-
- 总成绩 -
-
-
-
-
- 各学科成绩 - - - - - - - - - - - - - - - {present name="list.cj"} - {volist name="list.cj" id="vo"} - - - - - - {/volist} - {else /} - - - - - - {/present} - -
学科得分在班级超过
{$vo.title}{$vo.defen}{$vo.bweizhi}
-
-
-
-
- 学科得分率 - {present name="list.cj"} - {volist name="list.cj" id="vo"} -
- -
-
-
-
-
+
+
+
+
+
+ 各学科总分
-
- {/volist} - {/present} -
-
-
-
- 个人成绩与总平均分 -
-
-
+
+
+
+
+
+
+
+
+ 各学科得分 +
+
+
+
+
+
+
+
+
+ 各学科得分率 +
+
+
+
+
+
+
+
+
+ 各学科成绩与平均分对比 +
+
+
+
+
+
+
+
+
+ 各学科成绩位置 +
+
+
+
+
+
-
-
+ diff --git a/app/kaoshi/controller/Index.php b/app/kaoshi/controller/Index.php index fffbc808..2ee80465 100644 --- a/app/kaoshi/controller/Index.php +++ b/app/kaoshi/controller/Index.php @@ -42,7 +42,6 @@ class Index extends BaseController ,'order' => 'desc' ,'searchval' => '' ], 'POST'); - // 根据条件查询数据 $ks = new KS; $data = $ks->search($src) @@ -292,7 +291,7 @@ class Index extends BaseController ,'kaoshi_id' => '1' ], 'POST'); - $khSrc = new \app\kaohao\model\Search; + $khSrc = new \app\kaohao\model\SearchMore; $bj = $khSrc->cyBanji($src); $cnt = count($bj); diff --git a/app/kaoshi/controller/KaoshiSet.php b/app/kaoshi/controller/KaoshiSet.php index 3176bacb..e17bf312 100644 --- a/app/kaoshi/controller/KaoshiSet.php +++ b/app/kaoshi/controller/KaoshiSet.php @@ -28,7 +28,8 @@ class KaoshiSet extends BaseController $list['status'] = '/kaoshi/kaoshiset/status'; $ksset = new ksset; - $list['subject'] = $ksset->srcSubject($kaoshi_id); + $src['kaoshi_id'] = $kaoshi_id; + $list['subject'] = $ksset->srcSubject($src); $nj = $ksset->srcNianji($kaoshi_id); $kaoshi = new \app\kaoshi\model\Kaoshi; $list['sj'] = $kaoshi::where('id', $kaoshi_id)->value('bfdate'); diff --git a/app/kaoshi/model/Kaoshi.php b/app/kaoshi/model/Kaoshi.php index b6136f2b..3f368813 100644 --- a/app/kaoshi/model/Kaoshi.php +++ b/app/kaoshi/model/Kaoshi.php @@ -3,10 +3,10 @@ namespace app\kaoshi\model; // 引用数据模型基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; -class Kaoshi extends BaseModel +class Kaoshi extends KaoshiBase { // 查询所有考试 public function search($srcfrom) @@ -64,15 +64,15 @@ class Kaoshi extends BaseModel } - // 考试参加考试的学校、学科、年级、班级 - public function kaoshiInfo($id = 0) - { - // 获取参考年级 - $kaoshiList = $this->where('id', $id) - ->field('id, title, status, luru') - ->find(); - return $kaoshiList; - } + // // 考试参加考试的学校、学科、年级、班级 + // public function kaoshiInfo($id = 0) + // { + // // 获取参考年级 + // $kaoshiList = $this->where('id', $id) + // ->field('id, title, status, luru') + // ->find(); + // return $kaoshiList; + // } // 开始时间修改器 @@ -81,12 +81,14 @@ class Kaoshi extends BaseModel return strtotime($value); } + // 开始时间获取器 public function getBfdateAttr($value) { return date('Y-m-d', $value); } + // 结束时间修改器 public function setEnddateAttr($value) { @@ -95,18 +97,23 @@ class Kaoshi extends BaseModel return strtotime($sj); } + // 结束时间获取器 public function getEnddateAttr($value) { return date('Y-m-d', $value); } + // 参考学科获取器 public function getCkSubjectAttr($value) { // 查询参考学科 $ksset = new \app\kaoshi\model\KaoshiSet; - $subject = $ksset->srcSubject($this->getAttr('id'), '', ''); + $src = [ + 'kaoshi_id' => $this->getAttr('id') + ]; + $subject = $ksset->srcSubject($src); // 重新整理数据 $str = ''; foreach ($subject as $key => $value) { @@ -120,6 +127,7 @@ class Kaoshi extends BaseModel return $str; } + // 参考年级获取器 public function getCkNianjiAttr($value) { @@ -140,6 +148,7 @@ class Kaoshi extends BaseModel return $str; } + // 考试设置关联表 public function ksSet() { @@ -153,12 +162,14 @@ class Kaoshi extends BaseModel return $this->belongsTo('\app\system\model\Category', 'category_id', 'id'); } + // 考试成绩关联表 public function ksChengji() { return $this->hasMany('\app\chengji\model\Chengji', 'kaoshi_id', 'id'); } + // 考试组织单位关联表 public function ksZuzhi() { diff --git a/app/kaoshi/model/KaoshiBase.php b/app/kaoshi/model/KaoshiBase.php new file mode 100644 index 00000000..5c47dcf2 --- /dev/null +++ b/app/kaoshi/model/KaoshiBase.php @@ -0,0 +1,19 @@ + '0' + ,'nianji' => 0 + ,'subject_id' => array() + ); - $sbjList = $this->where('kaoshi_id', $kaoshi_id) - ->when(count($subject_id) > 0, function ($query) use ($subject_id) { - $query->where('subject_id', 'in', $subject_id); + $src = array_cover($srcfrom, $src); + $src['subject_id'] = strToarray($src['subject_id']); + + $sbjList = $this->where('kaoshi_id', $src['kaoshi_id']) + ->when(count($src['subject_id']) > 0, function ($query) use ($src) { + $query->where('subject_id', 'in', $src['subject_id']); }) - ->when($nianji > 0, function ($query) use ($nianji) { - $query->where('nianji', $nianji); + ->when($src['nianji'] > 0, function ($query) use ($src) { + $query->where('nianji', $src['nianji']); }) ->group('subject_id') ->field("subject_id @@ -77,7 +85,6 @@ class KaoshiSet extends BaseModel ->where('status', 1) ->select(); - // 重新整理学科信息 $data = array(); foreach ($sbjList as $key => $value) { @@ -110,7 +117,7 @@ class KaoshiSet extends BaseModel * @return \think\Response */ // 显示考试列表 - public function srcNianji($kaoshi_id) + public function srcGrade($kaoshi_id) { $njList = $this->where('kaoshi_id', $kaoshi_id) ->group('nianji') diff --git a/app/kaoshi/model/TongjiLog.php b/app/kaoshi/model/TongjiLog.php index ae03a3c6..2e7bc85d 100644 --- a/app/kaoshi/model/TongjiLog.php +++ b/app/kaoshi/model/TongjiLog.php @@ -4,12 +4,12 @@ declare (strict_types = 1); namespace app\Kaoshi\model; // 引用数据模型基类 -use app\BaseModel; +use \app\kaoshi\model\KaoshiBase; /** * @mixin think\Model */ -class TongjiLog extends BaseModel +class TongjiLog extends KaoshiBase { // 查询统计记录 public function search($srcfrom) diff --git a/app/login/controller/Index.php b/app/login/controller/Index.php index 2f7e055d..09717b7e 100644 --- a/app/login/controller/Index.php +++ b/app/login/controller/Index.php @@ -45,7 +45,6 @@ class Index // 登录验证 public function yanzheng() { - // 获取表单数据 $data = request()->only(['username','password','captcha','online']); @@ -53,7 +52,7 @@ class Index try { // 实例化验证模型 $validate = new \app\login\validate\Yanzheng; - validate(Yanzheng::class)->check($data); + validate(Yanzheng::class)->scene('admin')->check($data); } catch (ValidateException $e) { // 验证失败 输出错误信息 $data=['msg'=>$e->getError(),'status'=>0]; @@ -122,10 +121,11 @@ class Index if($check) { - session(null); - session('userid', $userinfo->id); - session('username', $username); - session('password', $password); + session('admin', null); + session('onlineCategory', 'admin'); + session('admin.userid', $userinfo->id); + session('admin.username', $username); + session('admin.password', $password); $data=['msg'=>'验证成功','status'=>1]; }else{ diff --git a/app/login/controller/Student.php b/app/login/controller/Student.php new file mode 100644 index 00000000..b721a494 --- /dev/null +++ b/app/login/controller/Student.php @@ -0,0 +1,149 @@ +isMobile(); + // 清除cookie + cookie('userid', null); + cookie('username', null); + cookie('password', null); + // 清除session(当前作用域) + session(null); + + // 获取系统名称和版本号 + $list['webtitle'] = Config::get('shangma.webtitle'); + $list['version'] = Config::get('shangma.version'); + $list['mobile'] = $mobile; + + View::assign('list',$list); + + // 渲染输出 + return View::fetch(); + } + + + // 成绩验证 + public function yanzheng() + { + // 获取表单数据 + $data = request()->only(['username','password','shenfenzhenghao','online']); + + // 验证表单数据 + try { + // 实例化验证模型 + $validate = new \app\login\validate\Yanzheng; + validate(Yanzheng::class)->scene('student')->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + $data=['msg'=>$e->getError(),'status'=>0]; + return json($data); + } + + // 验证用户名和密码 + $check = $this->check($data['username'],$data['password']); + + if($check['status']==1) + { + // 设置cookie值 + if( request()->post('online') == true ) + { + // 设置 + cookie('userid', session('userid')); + cookie('username', $data['username']); + cookie('password', $data['password']); + } + + // 将本次信息上传到服务器上 + $userinfo = stu::where('shenfenzhenghao',$data['username']) + ->field('lastip,ip,denglucishu,lasttime,thistime') + ->find(); + $userinfo->lastip = $userinfo->ip; + $userinfo->ip = request()->ip(); + $userinfo->denglucishu = ['inc', 1]; + $userinfo->lasttime = $userinfo->getData('thistime'); + $userinfo->thistime = time(); + $userinfo->save(); + + // 跳转到首页 + $data=['msg'=>'验证成功','status'=>1]; + }else{ + // 提示错误信息 + $data=['msg'=>$check['msg'],'status'=>0]; + } + + return json($data); + } + + + // 已知密码进行验证 + public function check($username,$password) + { + // 实例化加密类 + $md5 = new APR1_MD5(); + + // 获取服务器密码 + $userinfo = stu::where('shenfenzhenghao', $username)->where('status', 1)->find(); + + if($userinfo == null) + { + // 清除session(当前作用域) + session(null); + // 验证结果; + $data=['msg'=>'学生不存在或被禁用','status'=>0]; + return $data; + } + + //验证密码 + $check = $md5->check($password,$userinfo->password); + + if($check) + { + session('student', null); + session('onlineCategory', 'student'); + session('student.userid', $userinfo->id); + session('student.username', $username); + session('student.password', $password); + + $data=['msg'=>'验证成功','status'=>1]; + }else{ + // 清除cookie + cookie('userid', null); + cookie('username', null); + cookie('password', null); + // 清除session(当前作用域) + session(null); + $data=['msg'=>'学生身份证号或密码错误','status'=>0]; + } + return $data; + } + + + + + + + + +} diff --git a/app/login/controller/Teacher.php b/app/login/controller/Teacher.php new file mode 100644 index 00000000..293273a2 --- /dev/null +++ b/app/login/controller/Teacher.php @@ -0,0 +1,140 @@ +isMobile(); + // 清除cookie + cookie('userid', null); + cookie('username', null); + cookie('password', null); + // 清除session(当前作用域) + session(null); + + // 获取系统名称和版本号 + $list['webtitle'] = Config::get('shangma.webtitle'); + $list['version'] = Config::get('shangma.version'); + $list['mobile'] = $mobile; + + View::assign('list',$list); + + // 渲染输出 + return View::fetch(); + } + + + // 成绩验证 + public function yanzheng() + { + // 获取表单数据 + $data = request()->only(['username','password','shenfenzhenghao','online']); + + // 验证表单数据 + try { + // 实例化验证模型 + $validate = new \app\login\validate\Yanzheng; + validate(Yanzheng::class)->scene('student')->check($data); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + $data=['msg'=>$e->getError(),'status'=>0]; + return json($data); + } + + // 验证用户名和密码 + $check = $this->check($data['username'],$data['password'],$data['shenfenzhenghao']); + + if($check['status']==1) + { + // 设置cookie值 + if( request()->post('online') == true ) + { + // 设置 + cookie('userid', session('userid')); + cookie('username', $data['username']); + cookie('password', $data['password']); + } + + // 将本次信息上传到服务器上 + $userinfo = stu::where('username',$data['username']) + ->field('lastip,username,ip,denglucishu,lasttime,thistime') + ->find(); + $userinfo->lastip = $userinfo->ip; + $userinfo->ip = request()->ip(); + $userinfo->denglucishu = ['inc', 1]; + $userinfo->lasttime = $userinfo->getData('thistime'); + $userinfo->thistime = time(); + $userinfo->save(); + + // 跳转到首页 + $data=['msg'=>'验证成功','status'=>1]; + }else{ + // 提示错误信息 + $data=['msg'=>$check['msg'],'status'=>0]; + } + + return json($data); + } + + + // 已知密码进行验证 + public function check($username,$password) + { + // 实例化加密类 + $md5 = new APR1_MD5(); + + // 获取服务器密码 + $userinfo = stu::where('shenfenzhenghao', $username)->where('status', 1)->find(); + + if($userinfo == null) + { + // 清除session(当前作用域) + session(null); + // 验证结果; + $data=['msg'=>'学生不存在或被禁用','status'=>0]; + return $data; + } + + //验证密码 + $check = $md5->check($password,$userinfo->password); + + if($check) + { + session('teacher', null); + session('onlineCategory', 'teacher'); + session('teacher.userid', $userinfo->id); + session('teacher.username', $username); + session('teacher.password', $password); + + $data=['msg'=>'验证成功','status'=>1]; + }else{ + // 清除cookie + cookie('userid', null); + cookie('username', null); + cookie('password', null); + // 清除session(当前作用域) + session(null); + $data=['msg'=>'学生身份证号或密码错误','status'=>0]; + } + return $data; + } +} diff --git a/app/login/route/login.php b/app/login/route/login.php index 7789bdb9..895d7e7f 100644 --- a/app/login/route/login.php +++ b/app/login/route/login.php @@ -20,3 +20,15 @@ Route::group('', function () { }); +// 学生查询成绩登录 +Route::group('student', function () { + Route::rule('','Student/index','get'); + Route::rule('','Student/yanzheng','post'); +}); + +// 学生查询成绩登录 +Route::group('teacher', function () { + Route::rule('','Teacher/index','get'); + Route::rule('','Teacher/yanzheng','post'); +}); + diff --git a/app/login/validate/Yanzheng.php b/app/login/validate/Yanzheng.php index 53735505..6ed2c02a 100644 --- a/app/login/validate/Yanzheng.php +++ b/app/login/validate/Yanzheng.php @@ -19,6 +19,14 @@ class Yanzheng extends Validate ]; protected $message = [ - + 'admin' => [ + 'username' + ,'password' + ], + 'student' => [ + 'username' + ,'password' + ,'shengfenzhenghao' + ] ]; } diff --git a/app/login/view/index/index.html b/app/login/view/index/index.html index 896bb32a..ba23367b 100644 --- a/app/login/view/index/index.html +++ b/app/login/view/index/index.html @@ -31,23 +31,22 @@ -
-
{$list['webtitle']} {$list['version']}-管理员登录
+
+
{$list['webtitle']} {$list['version']}


- {neq name="list.mobile" value="true"} -
-
+ +
+
- {/neq}
- -
- 成绩查询传送门 + 学生查询 + 教师查询 +
diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html index 4ad898b3..8bea90ac 100644 --- a/app/login/view/index/shangma_log.html +++ b/app/login/view/index/shangma_log.html @@ -60,6 +60,10 @@ 修复已知错误
增加各分数段统计 +
+ 增加学生成绩查询 +
+ 取消录入成绩时对十分位的验证

diff --git a/app/login/view/student/index.html b/app/login/view/student/index.html new file mode 100644 index 00000000..8bc9b126 --- /dev/null +++ b/app/login/view/student/index.html @@ -0,0 +1,124 @@ + + + + + {$list['webtitle']} {$list['version']} + + + + + + + + + + + + + + + + + + +
+
{$list['webtitle']} {$list['version']}
+
+
+ +
+ +
+
+
+
+
+ 管理员 + 教师查询 + +
+
+
+ + + + + \ No newline at end of file diff --git a/app/login/view/teacher/index.html b/app/login/view/teacher/index.html new file mode 100644 index 00000000..22cea32b --- /dev/null +++ b/app/login/view/teacher/index.html @@ -0,0 +1,126 @@ + + + + + {$list['webtitle']} {$list['version']} + + + + + + + + + + + + + + + + + + +
+
{$list['webtitle']} {$list['version']}
+
+
+ +
+ +
+ +
+
+
+
+
+ 管理员 + 学生查询 + +
+
+
+ + + + + \ No newline at end of file diff --git a/app/middleware.php b/app/middleware.php index 32d02ce9..19ac7ef0 100644 --- a/app/middleware.php +++ b/app/middleware.php @@ -6,5 +6,5 @@ return [ // 多语言加载 // \think\middleware\LoadLangPack::class, // Session初始化 - \think\middleware\SessionInit::class + \think\middleware\SessionInit::class, ]; diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index 4e0e2b6b..34d8c084 100644 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -23,7 +23,7 @@ class Auth $admins = Config::get('auth.auth_config.administrator'); // 如果当前用户ID在配置排除的列表中,愚昧取消验证 - if(in_array(session('userid'),$admins)){ + if(in_array(session('admin.userid'),$admins)){ $admin = true; }else{ $admin = false; @@ -47,7 +47,6 @@ class Auth 'saveall', # 批量保存 ); - // 排除指定模块下的指定方法 $uneed_u = array( // Index应用 @@ -108,7 +107,7 @@ class Auth $auth = new AuthHandle; // 验证方法 - if( $auth->check($url, session('userid')) == false && $except == false && $admin == false ){// 第一个参数是规则名称,第二个参数是用户UID + if( $auth->check($url, session('admin.userid')) == false && $except == false && $admin == false ){// 第一个参数是规则名称,第二个参数是用户UID $this->error('哎哟~ 因为权限不足', '/login/err'); } diff --git a/app/middleware/Online.php b/app/middleware/Online.php new file mode 100644 index 00000000..891bb0cb --- /dev/null +++ b/app/middleware/Online.php @@ -0,0 +1,25 @@ +error('很长时间没有操作,登录超时啦~','/login/student'); + }else{ + $category = session('onlineCategory'); + if ($category != 'student') + { + $this->error('请使用学生帐号登录', '/login/student'); + } + } + + // 尝试从session中获取用户名和密码 + $username = session('?student.username') ? $username = session('student.username') : $username = ''; + $password = session('?student.password') ? $password = session('student.password') : $password = ''; + // 尝试从cookie中获取用户名和密码 + if (strlen($username)<1 ) + { + $username = cookie('?username') ? $username = cookie('username') : $username = ''; + $password = cookie('?password') ? $password = cookie('password') : $password = ''; + } + + $isajax = $request->isAjax(); + + // 如果没有获取到用户名和密码,则跳转到登录页面 + if(strlen($username)<1) + { + if($isajax) + { + $this->error('很长时间没有操作,登录超时啦~', '/login/err'); + }else{ + echo ""; + } + } + + // 检验用户名或密码是否正确 + $yz = new \app\login\controller\Student; + $yz = $yz->check($username,$password); + if($yz['status'] == 0){ + if($isajax) + { + $this->error('密码刚才修改过了,请重新登录~', '/login/err'); + }else{ + echo ""; + } + + } + + return $next($request); + } +} diff --git a/app/middleware/TeacherLogin.php b/app/middleware/TeacherLogin.php new file mode 100644 index 00000000..d74b83a0 --- /dev/null +++ b/app/middleware/TeacherLogin.php @@ -0,0 +1,56 @@ +isAjax(); + + // 如果没有获取到用户名和密码,则跳转到登录页面 + if(strlen($username)<1) + { + if($isajax) + { + $this->error('很长时间没有操作,登录超时啦~'); + }else{ + echo ""; + } + } + + // 检验用户名或密码是否正确 + $yz = new \app\login\controller\Teacher; + $yz = $yz->check($username,$password); + if($yz['status'] == 0){ + if($isajax) + { + $this->error('密码刚才修改过了,请重新登录~','/login/err'); + }else{ + echo ""; + } + + } + + return $next($request); + } +} diff --git a/app/middleware/UserLogin.php b/app/middleware/UserLogin.php index 38afdeca..be2ba170 100644 --- a/app/middleware/UserLogin.php +++ b/app/middleware/UserLogin.php @@ -5,7 +5,6 @@ namespace app\middleware; class UserLogin { - use \liliuwei\think\Jump; /** * 处理请求 * @@ -15,40 +14,30 @@ class UserLogin */ public function handle($request, \Closure $next) { + $category = session('onlineCategory'); + $isajax = $request->isAjax(); + if ($category != 'admin') + { + + \app\facade\OnLine::jump('/login', '请使用管理员帐号登录'); + } + // 尝试从session中获取用户名和密码 - $username = session('?username') ? $username = session('username') : $username = ''; - $password = session('?password') ? $password = session('password') : $password = ''; + $username = session('?admin.username') ? $username = session('admin.username') : $username = ''; + $password = session('?admin.password') ? $password = session('admin.password') : $password = ''; // 尝试从cookie中获取用户名和密码 - if (strlen($username)<1 ) + if (strlen($username) < 1 ) { $username = cookie('?username') ? $username = cookie('username') : $username = ''; $password = cookie('?password') ? $password = cookie('password') : $password = ''; } - $isajax = $request->isAjax(); - - // 如果没有获取到用户名和密码,则跳转到登录页面 - if(strlen($username)<1) - { - if($isajax) - { - $this->error('很长时间没有操作,登录超时啦~'); - }else{ - echo ""; - } - } - // 检验用户名或密码是否正确 $yz = new \app\login\controller\Index; $yz = $yz->check($username,$password); - if($yz['status'] == 0){ - if($isajax) - { - $this->error('密码刚才修改过了,请重新登录~','/login/err'); - }else{ - echo ""; - } + if($yz['status'] == 0){ + \app\facade\OnLine::jump('/login', '请使用新密码登录'); } return $next($request); diff --git a/app/searchtools/common.php b/app/searchtools/common.php new file mode 100644 index 00000000..d433d0cb --- /dev/null +++ b/app/searchtools/common.php @@ -0,0 +1,2 @@ +srcSubject($src); + return $data; + } + + + // 查询参加考试的年级 + public function grade($kaoshi_id) + { + $ksset = new ksset(); + $data = $ksset->srcGrade($kaoshi_id); + return $data; + } +} diff --git a/app/searchtools/event.php b/app/searchtools/event.php new file mode 100644 index 00000000..ec349f1b --- /dev/null +++ b/app/searchtools/event.php @@ -0,0 +1,5 @@ +request ->only([ 'kaohao_id' => '', diff --git a/app/student/model/StudentChengji.php b/app/student/model/OneStudentChengji1.php similarity index 82% rename from app/student/model/StudentChengji.php rename to app/student/model/OneStudentChengji1.php index f59149da..9551866c 100644 --- a/app/student/model/StudentChengji.php +++ b/app/student/model/OneStudentChengji1.php @@ -1,7 +1,7 @@ where('id', $src['kaohao_id']) + ->with([ + ' ksChengji' => function ($query) { + $query->field('id, kaohao_id, defen'); + } + ]) ->find(); + $sum = 0; + foreach ($khInfo->ksChengji as $key => $value) { + $sum = $sum + $value->defen; + } $src['ruxuenian'] = $khInfo->ruxuenian; #设置查询条件 $src['kaoshi_id'] = $khInfo->kaoshi_id; $khSrc = new \app\kaohao\model\Search; @@ -308,9 +317,8 @@ class StudentChengji extends BaseModel $data = array_column($data, 'id'); $rank = array_search($src['kaohao_id'], $data); $rank = 100 - round(($rank + 1) / count($data) * 100, 0); - $data = [ - 'title' => '学生成绩' + 'title' => '总分:' . $sum ,'series' => [ 'name'=>'总成绩' ,'type' => 'gauge' @@ -320,7 +328,7 @@ class StudentChengji extends BaseModel ]; } else { $data = [ - 'title' => '学生成绩' + 'title' => '总分:' . $sum ,'series' => [ 'name'=>'总成绩' ,'type' => 'gauge' @@ -329,12 +337,59 @@ class StudentChengji extends BaseModel ] ]; } + return $data; + } + // 查询某个学生所有学科成绩 + public function kaohaoSearch($srcfrom) + { + // 初始化参数 + $src = array( + 'kaohao_id' => '', + ); - + // 用新值替换初始值 + $src = array_cover($srcfrom, $src); + + // 成绩查询信息 + $kh = new \app\kaohao\model\Kaohao; #该考号对应的考试信息。 + $khInfo = $kh->where('id', $src['kaohao_id']) + ->with([ + 'ksChengji' => function ($query) { + $query->field('id, subject_id, defen, kaohao_id, defenlv, qweizhi') + ->with([ + 'subjectName' => function($q) { + $q->field('id, title'); + } + ]); + } + ]) + ->find(); + + $data = array(); + + $schtj = new \app\chengji\model\TongjiSch; + $schtjInfo = $schtj->where('kaoshi_id', $khInfo->kaoshi_id) + ->field('max,min,subject_id') + ->column(('max,min'),'subject_id'); + + foreach ($khInfo->ksChengji as $key => $value) { + $data[] = [ + 'id' => $value->id + ,'subject_name' => $value->subjectName->title + ,'subject_id' => $value->subject_id + ,'defen' => $value->defen + ,'defenlv' => $value->defenlv + ,'qweizhi' => $value->qweizhi + ,'max' => $schtjInfo[$value->subject_id]['max'] + ,'min' => $schtjInfo[$value->subject_id]['min'] + ]; + } return $data; } + + } diff --git a/app/student/view/index/index.html b/app/student/view/index/index.html index 277fc5f4..2eb4a82b 100644 --- a/app/student/view/index/index.html +++ b/app/student/view/index/index.html @@ -11,7 +11,7 @@ {/block} {block name="search"} -
+
diff --git a/app/studentSearchChengji/common.php b/app/studentSearchChengji/common.php new file mode 100644 index 00000000..d433d0cb --- /dev/null +++ b/app/studentSearchChengji/common.php @@ -0,0 +1,2 @@ +order(['id'=>'desc']) + ->field('thinks, danwei') + ->find(); + // 设置要给模板赋值的信息 + $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([ + 'stuBanji' => function ($query) { + $query->field('id, paixu, ruxuenian') + ->append(['banjiTitle']); + } + ]) + ->field('id, xingming, banji_id') + ->find(); + $list['xingming'] = $stuInfo->xingming; + $list['banjiTitle'] = $stuInfo->stuBanji->banjiTitle; + $list['student_id'] = session('student.userid'); + + // 模板赋值 + $this->view->assign('list', $list); + + return $this->view->fetch(); + } + + // 学生个人总分仪表图 + public function ajaxOneStudentChengjiYiBiao() + { + // 获取表单参数 + $src = $this->request + ->only([ + 'kaohao_id' => '', + ], 'POST'); + + // 获取学生成绩 + $stucj = new STUCJ; + $data = $stucj->oneStudentYiBiao($src); + + return json($data); + } + + + // 学生个人成绩列表 + public function ajaxOneStudentSubjectChengji() + { + // 获取表单参数 + // 获取参数 + $src = $this->request + ->only([ + 'kaohao_id' => '', + ], 'POST'); + + // 获取学生成绩 + $stucj = new STUCJ; + $data = $stucj->kaohaoSearch($src); + + // 整理变量 + $src = [ + 'field' => 'subject_id' + ,'order' => 'asc' + ,'page' => 1 + ,'limit' => 10 + ]; + + + $data = reSetArray($data, $src); + + return json($data); + } + + + // 学生个人成绩列表 + public function ajaxOneStudentSubjectDefenlv() + { + // 获取表单参数 + // 获取参数 + $src = $this->request + ->only([ + 'kaohao_id' => '', + ], 'POST'); + + // 获取学生成绩 + $stucj = new STUCJ; + $list = $stucj->kaohaoSearch($src); + $category = array(); + $data = array(); + foreach ($list as $key => $value) { + $category[] = $value['subject_name']; + $data[] = $value['defenlv']; + } + $data = [ + 'xAxis' => [ + 'type' => 'category' + ,'data' => $category + ] + ,'yAxis' => [ + 'type' => 'value' + ,'data' => '' + ] + ,'series' => [ + [ + 'data' => $data + ,'name' => '得分率%' + ,'type' => 'bar' + ,'label' => [ + 'show' => true + ,'position'=>'top' // 在上方显示 + ,'textStyle' => [ + 'color' => 'black', + 'fontSize' => 12 + ] + ] + ], + ] + ]; + + return json($data); + } + + + // 学生个人成绩雷达图 + public function ajaxOneStudentChengjiLeiDa() + { + // 获取表单参数 + $src = $this->request + ->only([ + 'kaohao_id' => '', + ], 'POST'); + + // 获取学生成绩 + $stucj = new STUCJ; + $data = $stucj->oneStudentLeiDa($src); + + return json($data); + } + + + // 学生个人成绩列表 + public function ajaxOneStudentSubjectWeizhi() + { + // 获取表单参数 + // 获取参数 + $src = $this->request + ->only([ + 'kaohao_id' => '', + ], 'POST'); + + // 获取学生成绩 + $stucj = new STUCJ; + $list = $stucj->kaohaoSearch($src); + $category = array(); + $data = array(); + foreach ($list as $key => $value) { + $category[] = $value['subject_name']; + $data[] = round($value['qweizhi'], 0); + } + $data = [ + 'xAxis' => [ + 'type' => 'value' + ,'data' => '' + ] + ,'yAxis' => [ + 'type' => 'category' + ,'data' => $category + ] + ,'series' => [ + [ + 'data' => $data + ,'name' => '超过%' + ,'type' => 'bar' + ,'label' => [ + 'show' => true + ,'position'=>'insideRight' // 在上方显示 + ,'textStyle' => [ + 'color' => 'black', + 'fontSize' => 12 + ] + ] + ], + ] + ]; + return json($data); + } + + + // 获取学生历次考试成绩 + public function ajaxOneStudentOldChengji() + { + // 获取表单参数 + $src = $this->request + ->only([ + 'page' => '1' + ,'limit' => '10' + ,'field' => 'kaoshi_id' + ,'order' => 'desc' + ,'student_id' => '' + ,'category_id' => '' + ,'xueqi_id' => '' + ,'bfdate' => '' + ,'enddate' => '' + ], 'POST'); + + + // 获取学生成绩 + $stucj = new STUCJ; + $khList = $stucj->oneStudentChengjiList($src); + $data = reSetArray($khList, $src); + + return json($data); + } + + + // 修改密码 + public function editpassword() + { + // 设置页面标题 + $list['set'] = array( + 'webtitle' => '修改密码' + ,'butname' => '修改' + ,'formpost' => 'PUT' + ,'url' => '/studentsearchchengji/index/updatepassword/' . session('student.userid') + ); + + // 模板赋值 + $this->view->assign('list', $list); + + // 渲染模板 + return $this->view->fetch('admin@index/edit_password'); + } + + + // 保存新密码 + public function updatePassword($id) + { + // 获取表单数据 + $list = request()->post(); + + // 验证表单数据 + $validate = new \app\admin\validate\SetPassword; + $result = $validate->check($list); + $msg = $validate->getError(); + + // 如果验证不通过则停止保存 + if(!$result){ + return json(['msg' => $msg, 'val' => 0]);; + } + + // 获取用户名 + $stu = new \app\student\model\Student; + $serpassword = $stu::where('id', $id)->value('password'); + + // 实例化加密类 + $md5 = new APR1_MD5(); + //验证密码 + $check = $md5->check($list['oldpassword'], $serpassword); + + if(!$check) + { + $data = ['msg' => '旧密码错误', 'val' => 0]; + return json($data); + } + + // 更新密码 + $password = $md5->hash($list['newpassword']); + $data = $stu::update(['id' => $id, 'password' => $password]); + + // 根据更新结果设置返回提示信息 + $data ? $data = ['msg' => '修改成功', 'val' => 1] + : $data = ['msg' => '数据处理错误', 'val' => 0]; + + // 返回信息 + return json($data); + } + +} diff --git a/app/studentSearchChengji/event.php b/app/studentSearchChengji/event.php new file mode 100644 index 00000000..ec349f1b --- /dev/null +++ b/app/studentSearchChengji/event.php @@ -0,0 +1,5 @@ + '' + ,'category_id' => '' + ,'xueqi_id' => '' + ,'bfdate' => '' + ,'enddate' => '' + ); + $src = array_cover($srcfrom, $src); + + // 查询成绩 + $khSrc = new \app\kaohao\model\Search; + $stuCj = $khSrc->srcOneStudentChengji($src); + + // 获取可以参加考试的学科 + $sbj = new \app\teach\model\Subject; + $sbjList = $sbj->where('kaoshi', 1) + ->where('status', 1) + ->field('id, lieming') + ->column('lieming', 'id'); + + // 整理数据 + $data = array(); + foreach ($stuCj as $key => $value) { + $data[$key] = [ + 'kaoshi_id' => $value->kaoshi_id, + 'kaoshiTitle' => $value->cjKaoshi->title, + 'kaohao_id' => $value->id, + 'banjiTitle' => $value->banjiTitle, + 'zuzhi_id' => $value->cjKaoshi->ksZuzhi->jiancheng, + 'category_id' => $value->cjKaoshi->ksCategory->title, + 'bfdate' => $value->cjKaoshi->bfdate, + 'enddate' => $value->cjKaoshi->enddate, + ]; + + $cjcnt = count($value->ksChengji); + + if($cjcnt > 0) + { + $sbj = $value->ksChengji->column('subject_id'); + foreach ($sbjList as $sbj_k => $sbj_val) { + // 通过学科ID获取这个学科成绩对应的成绩下标。 + // 这个地方需要再核实。 + $xb = array_search($sbj_k, $sbj); # ksChengji下标 + if($xb === false) + { + $data[$key][$sbj_val] = ''; + }else{ + $data[$key][$sbj_val] = $value->ksChengji[$xb]->defen; + } + } + $defen = array_column($value->ksChengji->toArray(), 'defen'); + $sum = array_sum($defen ); + $avg = $sum / $cjcnt; + $data[$key]['sum'] = $sum; + $data[$key]['avg'] = round($avg,2); + }else{ + foreach ($sbjList as $sbj_k => $sbj_val) { + $data[$key][$sbj_val] = ''; + } + $data[$key]['sum'] = ''; + $data[$key]['avg'] = ''; + } + } + return $data; + } + + + // 一个学生一个学科历次成绩 + public function subjectChengji($srcfrom) + { + // 初始化参数 + $src = array( + 'student_id' => '' + ,'kaoshi_id' => array() + ,'subject_id' => '' + ,'category_id' => '' + ,'xueqi_id' => '' + ,'bfdate' => '' + ,'enddate' => '' + ); + $src = array_cover( $srcfrom , $src ); + + $khSrc = new \app\kaohao\model\Search; + $stuCj = $khSrc->srcOneStudentChengji($src); + + + // 获取可以参加考试的学科 + $sbj = new \app\teach\model\Subject; + $sbjList = $sbj->where('kaoshi',1) + ->where('status',1) + ->field('id,lieming') + ->column('lieming','id'); + + // 整理数据 + $data = array(); + $xAxis = array(); + $series = [ + 0 => [ + 'name'=>'得分率%', + 'type'=>'line', + 'data'=>array(), + ], + 1 => [ + 'name'=>'班级位置%', + 'type'=>'line', + 'data'=>array(), + ], + 2 => [ + 'name'=>'学校位置%', + 'type'=>'line', + 'data'=>array(), + ], + 3 => [ + 'name'=>'全部位置%', + 'type'=>'line', + 'data'=>array(), + ], + ]; + foreach ($stuCj as $key => $value) { + $cjcnt = count($value->ksChengji); + if($cjcnt > 0) + { + foreach ($value->ksChengji as $sbj_k => $sbj_val) { + if($src['subject_id'] == $sbj_val->subject_id) + { + $xAxis[] = $value->cjKaoshi->title; + $series['0']['data'][] = $sbj_val->defenlv; + $series['1']['data'][] = round($sbj_val->bweizhi,0); + $series['2']['data'][] = round($sbj_val->xweizhi,0); + $series['3']['data'][] = round($sbj_val->qweizhi,0); + } + } + } + } + + $data = [ + 'xAxis' => $xAxis + ,'series' => $series + ,'legend' => [ + '得分率%' + ,'班级位置%' + ,'学校位置%' + ,'全部位置%' + ] + ]; + + return $data; + } + + + // 该学生本次考试各学科成绩雷达图 + public function leiDa($srcfrom) + { + // 初始化参数 + $src = array( + 'kaohao_id' => '', + ); + + // 用新值替换初始值 + $src = array_cover($srcfrom, $src); + + $kh = new \app\kaohao\model\Kaohao; + // 考号信息 + $khInfo = $kh->where('id', $src['kaohao_id']) + ->with([ + 'ksChengji'=>function($query){ + $query->field('id,kaohao_id,subject_id,defen'); + } + ]) + ->find(); + + // 参加考试学科 + $subject = subjectList(1,1); + // 获取参加考试学科满分 + $ksset = new \app\kaoshi\model\KaoshiSet; + $manfen = $ksset->srcSubject($khInfo->kaoshi, '', $khInfo->ruxuenian); + + // 查询区成绩 + $SchoolChengji = new \app\chengji\model\TongjiSch; + $schcj = $SchoolChengji + ->where('kaoshi_id',$khInfo->kaoshi_id) + ->where('ruxuenian',$khInfo->ruxuenian) + ->select(); + + // 循环写入成绩 + $indicator = array(); + $legend = ['得分','全体平均分']; + $bjcj = array(); + $bjcj['name'] = '得分'; + $qcj = array(); + $qcj['name'] = '全体平均分'; + $i = 0; + + foreach ($subject as $sbj_k => $sbj_val) { + + // 试卷满分 + if(isset($indicator[$i]) == false) + { + $indicator[$i]['name'] = $sbj_val->title; + foreach ($manfen as $mf_k => $mf_val) { + if($sbj_val['id'] == $mf_val['id']) + { + $indicator[$i]['max'] = $mf_val['fenshuxian']['manfen']; + continue; + } + if(isset($indicator[$i]) == false) + { + $indicator[$i]['max'] = null; + } + } + } + + // 学生成绩 + if(isset($bjcj['value'][$i]) == false) + { + foreach ($khInfo->ksChengji as $cj_k => $cj_val) { + if($sbj_val['id'] == $cj_val->subject_id) + { + $bjcj['value'][$i] = $cj_val->defen; + unset($khInfo->ksChengji[$cj_k]); + continue; + } + } + } + if(isset($bjcj['value'][$i]) == false) + { + $bjcj['value'][$i] = null; + } + + // 班级成绩 + if(isset($qcj['value'][$i]) == false) + { + foreach ($schcj as $sch_k => $sch_val) { + if($sbj_val['id'] == $sch_val->subject_id) + { + $qcj['value'][$i] = $sch_val->avg; + unset($schcj[$sch_k]); + continue; + } + + } + } + if(isset($qcj['value'][$i]) == false) + { + $qcj['value'][$i] = null; + } + + $i++; + } + + $data = [ + 'title' => '学生成绩' + ,'legend' => $legend + ,'indicator' => $indicator + ,'series' => [ + 'name'=>'成绩' + ,'type' => 'radar' + ,'data' => [$bjcj, $qcj] + ] + ]; + + return $data; + } + + + // 该学生本次考试各学科成绩仪表图 + public function yiBiao($srcfrom) + { + // 初始化参数 + $src = array( + 'kaohao_id' => '', + ); + + // 用新值替换初始值 + $src = array_cover($srcfrom, $src); + + // 成绩查询信息 + $kh = new \app\kaohao\model\Kaohao; #该考号对应的考试信息。 + $khInfo = $kh->where('id', $src['kaohao_id']) + ->with([ + ' ksChengji' => function ($query) { + $query->field('id, kaohao_id, defen'); + } + ]) + ->find(); + $sum = 0; + foreach ($khInfo->ksChengji as $key => $value) { + $sum = $sum + $value->defen; + } + $src['ruxuenian'] = $khInfo->ruxuenian; #设置查询条件 + $src['kaoshi_id'] = $khInfo->kaoshi_id; + $khSrc = new \app\kaohao\model\Search; + $src['banji_id'] = array_column($khSrc->cyBanji($src), 'id'); + + // 实例化并查询成绩 + $cj = new \app\chengji\model\Chengji; + $data = $cj->search($src); + if (count($data)>0) { + $data = sortArrByManyField($data, 'sum', SORT_DESC); + $data = array_column($data, 'id'); + $rank = array_search($src['kaohao_id'], $data); + $rank = 100 - round(($rank + 1) / count($data) * 100, 0); + $data = [ + 'title' => '总分:' . $sum + ,'series' => [ + 'name'=>'总成绩' + ,'type' => 'gauge' + // ,'detail' => $rank . '%' + ,'data' => [['value'=>$rank, 'name'=>'超过']] + ] + ]; + } else { + $data = [ + 'title' => '总分:' . $sum + ,'series' => [ + 'name'=>'总成绩' + ,'type' => 'gauge' + // ,'detail' => $rank . '%' + ,'data' => [['value'=>0, 'name'=>'超过']] + ] + ]; + } + return $data; + } + + + // 查询某个学生单次所有学科成绩 + public function oneChengji($srcfrom) + { + // 初始化参数 + $src = array( + 'kaohao_id' => '', + ); + + // 用新值替换初始值 + $src = array_cover($srcfrom, $src); + + // 成绩查询信息 + $kh = new \app\kaohao\model\Kaohao; #该考号对应的考试信息。 + $khInfo = $kh->where('id', $src['kaohao_id']) + ->with([ + 'ksChengji' => function ($query) { + $query->field('id, subject_id, defen, kaohao_id, defenlv, qweizhi') + ->with([ + 'subjectName' => function($q) { + $q->field('id, title'); + } + ]); + } + ]) + ->find(); + + $data = array(); + + $schtj = new \app\chengji\model\TongjiSch; + $schtjInfo = $schtj->where('kaoshi_id', $khInfo->kaoshi_id) + ->field('max,min,subject_id') + ->column(('max,min'),'subject_id'); + + foreach ($khInfo->ksChengji as $key => $value) { + $data[] = [ + 'id' => $value->id + ,'subject_name' => $value->subjectName->title + ,'subject_id' => $value->subject_id + ,'defen' => $value->defen + ,'defenlv' => $value->defenlv + ,'qweizhi' => $value->qweizhi + ,'max' => $schtjInfo[$value->subject_id]['max'] + ,'min' => $schtjInfo[$value->subject_id]['min'] + ]; + } + + return $data; + } +} diff --git a/app/studentSearchChengji/route/student.php b/app/studentSearchChengji/route/student.php new file mode 100644 index 00000000..1de89069 --- /dev/null +++ b/app/studentSearchChengji/route/student.php @@ -0,0 +1,25 @@ + +// +---------------------------------------------------------------------- +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('editpassword','Index/editpassword','get'); # 信息列表 + Route::rule('updatepassword/','Index/updatePassword','put'); # 信息列表 + +}); diff --git a/app/studentSearchChengji/view/index/index.html b/app/studentSearchChengji/view/index/index.html new file mode 100644 index 00000000..79c3ac85 --- /dev/null +++ b/app/studentSearchChengji/view/index/index.html @@ -0,0 +1,427 @@ + + + + + {$list.webtitle} + + + + + + {load href="__XADMIN__/css/font.css" /} + {load href="__XADMIN__/css/xadmin.css" /} + {load href="__STATIC__/mayi/css/studentSearch.css" /} + {load href="__XADMIN__/js/jquery.min.js" /} + {load href="__XADMIN__/lib/layui/layui.js" /} + {load href="__XADMIN__/js/xadmin.js" /} + {load href="__XADMIN__/js/cookie.js" /} + {load href="__XADMIN__/js/md5.min.js" /} + {load href="__STATIC__/echarts/echarts.js" /} + + + + + + + + + + + + + {if ( session('student.password') == 123) } +
+ 您现在使用的是默认密码,为了您的信息不被漏,请及时修改密码。 +
+ {/if} +
+
+ {$list.kaoshi_title}考试成绩({$list.kaoshi_date}) +
+
+
+
+
+ 各学科总分 +
+
+
+
+
+
+
+
+
+ 各学科得分 +
+
+
+
+
+
+
+
+
+ 各学科得分率 +
+
+
+
+
+
+
+
+
+ 各学科成绩与平均分对比 +
+
+
+
+
+
+
+
+
+ 各学科成绩位置 +
+
+
+
+
+
+
+
+
+
+
+
+ 感谢{$list.thinks}提供技术支持。
+ 本系统由{$list.danwei}负责管理 +
+
+
+ + + diff --git a/app/teacherSearchChengji/common.php b/app/teacherSearchChengji/common.php new file mode 100644 index 00000000..d433d0cb --- /dev/null +++ b/app/teacherSearchChengji/common.php @@ -0,0 +1,2 @@ + 0, + 'expire' => 7200, // cookie 保存路径 'path' => '/', // cookie 有效域名 diff --git a/config/middleware.php b/config/middleware.php index e6a649d8..8c0a4b3d 100644 --- a/config/middleware.php +++ b/config/middleware.php @@ -5,10 +5,14 @@ return [ 'alias' => [ 'login' => app\middleware\Userlogin::class, 'auth' => app\middleware\Auth::class, + 'stulogin' => app\middleware\StudentLogin::class, + 'terlogin' => app\middleware\TeacherLogin::class, + 'online' => app\middleware\Online::class, ], // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行 'priority' => [ - 'login', + 'online', + 'login', 'auth', ], ]; diff --git a/database/migrations/20181028023517_teacher.php b/database/migrations/20181028023517_teacher.php index 668dffed..d0df9eb6 100644 --- a/database/migrations/20181028023517_teacher.php +++ b/database/migrations/20181028023517_teacher.php @@ -48,6 +48,12 @@ class Teacher extends Migrator ->addColumn('shoupin','string',['limit'=>5,'default'=>'a','null'=>false,'comment'=>'简拼']) ->addColumn('tuixiu','boolean',['limit'=>1,'default'=>0,'null'=>false,'comment'=>'是否已经退休']) ->addColumn('status','boolean',['limit'=>1,'default'=>true,'null'=>false,'comment'=>'状态']) + ->addColumn('password','string',['limit'=>137,'null'=>false,'default'=>'$apr1$RSUodBwI$zOhVq9RQWfQDOW2sbeCDS1','comment'=>'登录密码']) + ->addColumn('denglucishu','integer',['limit'=>5,'default'=>0,'null'=>false,'comment'=>'登录次数']) + ->addColumn('lastip','string',['limit'=>55,'default'=>'127.0.0.1','null'=>false,'comment'=>'最后一次登录IP']) + ->addColumn('ip','string',['limit'=>55,'default'=>'127.0.0.1','null'=>false,'comment'=>'登录IP']) + ->addColumn('lasttime','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'最后登录时间']) + ->addColumn('thistime','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'本次登录时间']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) diff --git a/database/migrations/20181102003411_student.php b/database/migrations/20181102003411_student.php index 9b793e77..0e16075f 100644 --- a/database/migrations/20181102003411_student.php +++ b/database/migrations/20181102003411_student.php @@ -38,6 +38,11 @@ class Student extends Migrator ->addColumn('shengri','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'生日']) ->addColumn('shenfenzhenghao','string',['limit'=>18,'default'=>'N1539158918','null'=>false,'comment'=>'身份证号']) ->addColumn('password','string',['limit'=>137,'null'=>false,'default'=>'$apr1$RSUodBwI$zOhVq9RQWfQDOW2sbeCDS1','comment'=>'登录密码']) + ->addColumn('denglucishu','integer',['limit'=>5,'default'=>0,'null'=>false,'comment'=>'登录次数']) + ->addColumn('lastip','string',['limit'=>55,'default'=>'127.0.0.1','null'=>false,'comment'=>'最后一次登录IP']) + ->addColumn('ip','string',['limit'=>55,'default'=>'127.0.0.1','null'=>false,'comment'=>'登录IP']) + ->addColumn('lasttime','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'最后登录时间']) + ->addColumn('thistime','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'本次登录时间']) ->addColumn('banji_id','integer',['limit'=>11,'default'=>1,'null'=>false,'comment'=>'班级']) ->addColumn('kaoshi','boolean',['limit'=>1,'default'=>1,'null'=>false,'comment'=>'是否参加考试']) ->addColumn('quanpin','string',['limit'=>30,'default'=>'a','null'=>false,'comment'=>'全拼']) diff --git a/public/static/mayi/css/studentSearch.css b/public/static/mayi/css/studentSearch.css new file mode 100644 index 00000000..4edb3e6d --- /dev/null +++ b/public/static/mayi/css/studentSearch.css @@ -0,0 +1,26 @@ +.myrow { + width: 100%; + height: 45px; + background-color: #f1f1f1; + text-align: center; +} +.mydivtop { + padding: 5px; +} +.mydivneirong { + border-style: solid; + border-color: #eeeeee; + border-width: 1px; + padding: 5px; +} +.mydivtitle { + background: #009688; + height: 30px; + font-size: 16px; + text-align: center; + padding-top:7px; +} +.mydivtubiao { + background: #fff; + height: 350px; +} \ No newline at end of file diff --git a/view/list.html b/view/list.html index ec18b5fc..65002bbf 100644 --- a/view/list.html +++ b/view/list.html @@ -24,8 +24,8 @@ var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); - hm.src = "https://hm.baidu.com/hm.js?6f65eecea5e089dae94d6b9cffec3623"; - var s = document.getElementsByTagName("script")[0]; + hm.src = "https://hm.baidu.com/hm.js?1fe9097e79cfcf0c8d4547c3a1ba50e0"; + var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();