From 495921d85e0bb9b20a353be2243a84184fbfa96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Fri, 24 May 2019 15:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=90=E5=8F=B7=E4=BF=A1=E6=81=AF=E5=92=8C?= =?UTF-8?q?=E6=95=99=E5=B8=88=E4=BF=A1=E6=81=AF=E6=9F=A5=E7=9C=8B=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 25 +- application/admin/view/index/index.html | 3 +- application/admin/view/index/read.html | 115 ++--- application/http/middleware/YanZheng.php | 4 +- application/index/view/index/index.html | 14 +- application/keti/model/Keti.php | 2 +- application/keti/model/KetiInfo.php | 3 +- application/renshi/controller/Index.php | 123 +++++- application/renshi/model/Student.php | 2 +- application/renshi/model/Teacher.php | 3 + application/renshi/view/index/index.html | 4 +- application/renshi/view/index/read.html | 423 ++++++++----------- application/rongyu/model/JsRongyu.php | 5 +- application/rongyu/model/JsRongyuInfo.php | 4 +- application/rongyu/view/js_rongyu/index.html | 8 + database/seeds/Rule.php | 1 - route/admin.php | 3 +- route/renshi.php | 4 + 18 files changed, 427 insertions(+), 319 deletions(-) diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index bca95233..c8062fc8 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -132,9 +132,11 @@ class Index extends Base // 读取用户信息 public function read($id) { - // 获取管理员信息 - $list = AD::where('id',$id)->find(); + $list = AD::where('id',$id) + ->field('id,xingming,sex,shengri,username,school,phone,denglucishu,lastip,ip,lasttime,thistime,create_time,update_time') + ->find(); + $list['webtitle'] = '帐号信息'; // 模板赋值 $this->assign('list',$list); @@ -143,6 +145,25 @@ class Index extends Base return $this->fetch(); } + + // 读取用户信息 + public function myinfo() + { + $id = session('userid'); + // 获取管理员信息 + $list = AD::where('id',$id) + ->field('id,xingming,sex,shengri,username,school,phone,denglucishu,lastip,ip,lasttime,thistime,create_time,update_time') + ->find(); + $list['webtitle'] = '我的信息'; + + // 模板赋值 + $this->assign('list',$list); + + + // 渲染模板 + return $this->fetch('read'); + } + diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index bb2747a6..f7a260ab 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -37,6 +37,7 @@ @@ -99,7 +100,7 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'detail':// 查看 - layer.msg('查看' + data.id); + cjgl.add(obj.data.xingming+'信息','/admin/'+obj.data.id,'','',true); break; case 'del':// 删除 cjgl.del(obj,"/admin"); diff --git a/application/admin/view/index/read.html b/application/admin/view/index/read.html index d0912f70..f826fabe 100644 --- a/application/admin/view/index/read.html +++ b/application/admin/view/index/read.html @@ -1,51 +1,64 @@ -{extend name="common@admininfo" /} -{block name="topdiv"} -
- -
-
- {$list.xingming} - 帐号:{$list.username} -
-
这家伙很懒,什么也没有留下
-
-
-{/block} -{block name="mytable"} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
性别:{$list.sex}
出生日期:{$list.shengri}
手机:{$list.phone}
注册时间:{$list.create_time}
登录次数:{$list.denglucishu}
最后登录时间:{$list.lasttime}
最后登录IP:{$list.lastip}
备注:{$list.beizhu}
-{/block} \ No newline at end of file + + + + + {php}echo session('webtitle'){/php} + + + + {load href="__STATIC__/xadmin/css/font.css" /} + {load href="__STATIC__/xadmin/css/xadmin.css" /} + {load href="__STATIC__/xadmin/js/jquery.min.js" /} + {load href="__STATIC__/xadmin/lib/layui/layui.js" /} + {load href="__STATIC__/xadmin/js/xadmin.js" /} + {load href="__STATIC__/xadmin/js/cookie.js" /} + {load href="__STATIC__/xadmin/js/md5.min.js" /} + {$list.webtitle} + + +
+ +
+ 个人信息 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
帐号{$list.username}
姓名{$list.xingming}
性别{$list.sex}
出生日期{$list.shengri}
联系电话{$list.phone}
登录次数{$list.denglucishu}
上次登录IP{$list.lastip}         + {$list.lasttime}
本次登录IP{$list.ip}         + {$list.thistime}
注册时间{$list.create_time}
更新时间{$list.update_time}
+
+
+ + \ No newline at end of file diff --git a/application/http/middleware/YanZheng.php b/application/http/middleware/YanZheng.php index 53283e78..8c6fb078 100644 --- a/application/http/middleware/YanZheng.php +++ b/application/http/middleware/YanZheng.php @@ -49,11 +49,11 @@ class YanZheng extends Controller $uneed_c = array(); # 荣誉器名首字母要大写 // 排除方法 $uneed_a = array( - 'welcome','update','save','upload', + 'welcome','update','save','upload','myinfo', 'index','mybanji','banjilist', 'editpassword','updatepassword', // 教师信息查询 - 'srcteacher', + 'srcteacher','srcry','srckt', // 查询班级成绩、查询年级成绩 'ajaxbianji','ajaxnianji', // 批量保存 diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index 1bc80a9c..e7188292 100644 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -28,12 +28,14 @@
@@ -41,8 +43,8 @@
  • {$list.username}
    -
    个人信息
    - +
    个人信息
    +
    切换帐号
  • diff --git a/application/keti/model/Keti.php b/application/keti/model/Keti.php index 2020cba7..4489eb3e 100644 --- a/application/keti/model/Keti.php +++ b/application/keti/model/Keti.php @@ -39,7 +39,7 @@ class Keti extends Base ) ->withCount(['ktInfo'=>'lxcount'],'id') ->withCount(['ktInfo'=>function($query){ - $query->where('id','between',[1,1000]); + $query->where('jddengji','between',[1,2]); }]) ->select(); diff --git a/application/keti/model/KetiInfo.php b/application/keti/model/KetiInfo.php index 26c84b64..fcf615aa 100644 --- a/application/keti/model/KetiInfo.php +++ b/application/keti/model/KetiInfo.php @@ -88,8 +88,7 @@ class KetiInfo extends Base } ]); } - ] - ) + ]) ->select(); diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index e50034cf..f43b5652 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -125,9 +125,10 @@ class Index extends Base return json($data); } - // + // 查看教师信息 public function read($id) { + // 查询教师信息 $myInfo = Teacher::where('id',$id) ->with( @@ -149,14 +150,13 @@ class Index extends Base }, ] ) + ->append(['age','gongling']) ->limit(1) ->select(); $myInfo = $myInfo[0]; - // 设置数据总数 - $myInfo['count'] = ''; // 设置页面标题 - $myInfo['title'] = $myInfo->xingming; - + $myInfo['webtitle'] = $myInfo->xingming.'信息'; + // 模板赋值 $this->assign('list',$myInfo); // 渲染模板 @@ -403,5 +403,118 @@ class Index extends Base } + // 查询教师荣誉 + public function srcRy($teacherid) + { + // 实例化荣誉数据模型 + $ry = new \app\rongyu\model\JsRongyuInfo; + + // 查询荣誉信息 + $data = $ry->where('status',1) + ->where('id','in',function($query) use($teacherid){ + $query->name('jsRongyuCanyu') + ->where('teacherid',$teacherid) + ->field('rongyuid'); + }) + ->with( + [ + 'jxCategory'=>function($query){ + $query->field('id,title'); + }, + 'ryTuce'=>function($query){ + $query->field('id,title,fzschool,category') + ->with([ + 'fzSchool'=>function($query){ + $query->field('id,jiancheng,jibie') + ->with(['dwJibie'=>function($q){ + $q->field('id,title'); + }]); + }, + 'lxCategory'=>function($query){ + $query->field('id,title'); + }, + + ]); + }, + 'hjJsry'=>function($query){ + $query->field('rongyuid,teacherid') + ->with(['teacher'=>function($query){ + $query->field('id,xingming'); + }]); + }, + ]) + ->field('id,rongyuce,jiangxiang,hjshijian,title') + ->order('hjshijian') + ->select(); + + // 获取符合条件记录总数 + $cnt = $data->count(); + + // 重组返回内容 + $data = [ + 'code'=> 0 , // ajax请求次数,作为标识符 + 'msg'=>"", // 获取到的结果数(每页显示数量) + 'count'=>$cnt, // 符合条件的总数据量 + 'data'=>$data, //获取到的数据结果 + ]; + + + return json($data); + } + + + // 查询教师课题 + public function srcKt($teacherid) + { + // 实例化荣誉数据模型 + $ry = new \app\keti\model\KetiInfo; + + // 查询荣誉信息 + $data = $ry->where('status',1) + ->where('id','in',function($query) use($teacherid){ + $query->name('KetiCanyu') + ->where('teacherid',$teacherid) + ->field('ketiinfoid'); + }) + ->with( + [ + 'fzSchool'=>function($query){ + $query->field('id,jiancheng,jibie') + ->with(['dwJibie'=>function($q){ + $q->field('id,title'); + }]); + }, + 'ktCategory'=>function($query){ + $query->field('id,title'); + }, + 'ktZcr'=>function($query){ + $query->field('ketiinfoid,teacherid') + ->with([ + 'teacher'=>function($q){ + $q->field('id,xingming'); + } + ]); + } + ]) + ->field('id,title,fzdanweiid,category,jddengji') + ->order('id') + ->select(); + + // 获取符合条件记录总数 + $cnt = $data->count(); + + // 重组返回内容 + $data = [ + 'code'=> 0 , // ajax请求次数,作为标识符 + 'msg'=>"", // 获取到的结果数(每页显示数量) + 'count'=>$cnt, // 符合条件的总数据量 + 'data'=>$data, //获取到的数据结果 + ]; + + + return json($data); + } + + } diff --git a/application/renshi/model/Student.php b/application/renshi/model/Student.php index 97f5f708..fa3c7cb6 100644 --- a/application/renshi/model/Student.php +++ b/application/renshi/model/Student.php @@ -77,7 +77,7 @@ class Student extends Base $query->field('id,ruxuenian,paixu')->append(['banjiTitle']); } ]) - ->field('id,xingming,school,sex,shengri') + ->field('id,xingming,school,sex,shengri,banji') ->append(['age']) ->select(); diff --git a/application/renshi/model/Teacher.php b/application/renshi/model/Teacher.php index 87fad972..57dc1e1c 100644 --- a/application/renshi/model/Teacher.php +++ b/application/renshi/model/Teacher.php @@ -139,4 +139,7 @@ class Teacher extends Base } + + + } diff --git a/application/renshi/view/index/index.html b/application/renshi/view/index/index.html index 88b32016..2a99d2c4 100644 --- a/application/renshi/view/index/index.html +++ b/application/renshi/view/index/index.html @@ -74,7 +74,7 @@ @@ -146,7 +146,7 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'detail':// 查看 - layer.msg('查看' + data.id); + cjgl.add(obj.data.xingming+'信息','/teacher/'+obj.data.id,'','',true); break; case 'del':// 删除 cjgl.del(obj,"/teacher"); diff --git a/application/renshi/view/index/read.html b/application/renshi/view/index/read.html index 73c11da0..1e6d45dd 100644 --- a/application/renshi/view/index/read.html +++ b/application/renshi/view/index/read.html @@ -1,245 +1,186 @@ - - - - - - - - - - - -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/static/h-ui/css/H-ui.min.css" /} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/static/h-ui.admin/css/H-ui.admin.css" /} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/Hui-iconfont/1.0.8/iconfont.css" /} -{css href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/static/h-ui.admin/skin/default/skin.css" id="skin" /} -{css rel="stylesheet" type="text/css" href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/static/h-ui.admin/css/style.css" /} -{css rel="stylesheet" type="text/css" href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/datatables/1.10.15/css/jquery.dataTables.css" /} - - -{$list.title} - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    姓名:{$list.xingming}性别:{$list.sex}
    出生日期:{$list.shengri}职称{$list.js_zhicheng.title}
    工作单位:{$list.js_danwei.title}参加工作时间:{$list.worktime}
    毕业学校:{$list.biye}专业:{$list.zhuanye}
    学历:{$list.js_xueli.title}任教学科:{$list.js_subject.title}
    备注:{$list.beizhu}
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    标题编号级别奖项荣誉册单位时间
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ID用户名性别手机邮箱地址加入时间状态操作
    1张三男13000000000admin@mail.com北京市 海淀区2014-6-11 11:11:42已启用
    -
    -
    - -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/jquery/1.9.1/jquery.min.js"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/layer/2.4/layer.js"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/static/h-ui/js/H-ui.min.js"} -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/static/h-ui.admin/js/H-ui.admin.js"} - + + + + + {php}echo session('webtitle'){/php} + + + + {load href="__STATIC__/xadmin/css/font.css" /} + {load href="__STATIC__/xadmin/css/xadmin.css" /} + {load href="__STATIC__/xadmin/js/jquery.min.js" /} + {load href="__STATIC__/xadmin/lib/layui/layui.js" /} + {load href="__STATIC__/xadmin/js/xadmin.js" /} + {load href="__STATIC__/xadmin/js/cookie.js" /} + {load href="__STATIC__/xadmin/js/md5.min.js" /} + {$list.webtitle} + + +
    + +
    + 个人信息 +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -{js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/datatables/1.10.15/js/jquery.dataTables.min.js"} - - + //第二个实例 + var kt =table.render({ + elem: '#keti' + ,method:"POST" //数据接口 + ,url: '/srckt/'+"{$list.id}" //数据接口 + ,page: false //开启分页 + ,cols: [[ //表头 + {type:'numbers',sort:true,width:100,title:'序号'} + ,{field: 'title',sort:true, title: '课题名称', minWidth:200} + ,{field: 'bianhao',sort:true, title: '课题编号'} + ,{title: '主持人',templet:function(d){ + var str=''; + if(d.kt_zcr) + { + for (var k = 0, length = d.kt_zcr.length; k < length; k++) { + if(k == 0){ + str = d.kt_zcr[k].teacher.xingming; + }else{ + str =str+'、'+d.kt_zcr[k].teacher.xingming; + } + } + } + return str; + }} + ,{title: '立项单位',sort:true, minWidth: 177,templet:function(d){ + var str=''; + if(d.fz_school) + { + str = d.fz_school.jiancheng; + } + return str; + }} + ,{title: '级别',sort:true, minWidth: 177,templet:function(d){ + var str=''; + if(d.fz_school) + { + str = d.fz_school.dw_jibie.title; + } + return str; + }} + ,{field: 'jddengji',sort:true, title: '课题状态'} + ]] + }); + }); + + \ No newline at end of file diff --git a/application/rongyu/model/JsRongyu.php b/application/rongyu/model/JsRongyu.php index 5da5499f..1cf9de1d 100644 --- a/application/rongyu/model/JsRongyu.php +++ b/application/rongyu/model/JsRongyu.php @@ -30,7 +30,10 @@ class JsRongyu extends Base ->with( [ 'fzSchool'=>function($query){ - $query->field('id,jiancheng'); + $query->field('id,jiancheng,jibie') + ->with(['dwJibie'=>function($q){ + $q->field('id,title'); + }]); }, 'lxCategory'=>function($query){ $query->field('id,title'); diff --git a/application/rongyu/model/JsRongyuInfo.php b/application/rongyu/model/JsRongyuInfo.php index f7191483..756434bd 100644 --- a/application/rongyu/model/JsRongyuInfo.php +++ b/application/rongyu/model/JsRongyuInfo.php @@ -201,7 +201,7 @@ class JsRongyuInfo extends Base return $this->belongsTo('\app\system\model\Category','jiangxiang','id'); } - // 获奖人关联 + // 获奖人信息关联 public function hjJsry() { return $this->hasMany('\app\rongyu\model\JsRongyuCanyu','rongyuid','id')->where('category',1); @@ -215,7 +215,7 @@ class JsRongyuInfo extends Base } - // 获奖人关联 + // 参与人关联 public function cyJsry() { return $this->hasMany('\app\rongyu\model\JsRongyuCanyu','rongyuid','id')->where('category',2); diff --git a/application/rongyu/view/js_rongyu/index.html b/application/rongyu/view/js_rongyu/index.html index 60f4647d..9427edb4 100644 --- a/application/rongyu/view/js_rongyu/index.html +++ b/application/rongyu/view/js_rongyu/index.html @@ -82,6 +82,14 @@ } return str; }}, + {field: "category",title: '级别',templet:function(d){ + var str=''; + if(d.fz_school) + { + str = d.fz_school.dw_jibie.title; + } + return str; + }}, {field: 'count', title: '荣誉数', sort: true}, {field: 'fzshijian', title: '颁奖时间', sort: true}, {field: 'status', title: '状态',templet:'#status', sort: true}, diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index 77d2abb7..37d3e1f8 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -18,7 +18,6 @@ class Rule extends Seeder $rows= [ // 一级菜单 1 ['id'=>1,'title' =>'成绩采集','name'=>'chengji','paixu' =>1,'ismenu' =>true,'font'=>''], - ['id'=>2,'title' =>'成绩统计','name'=>'tongji','paixu' =>2,'ismenu' =>true,'font'=>'','status'=>false], ['id'=>3,'title' =>'考试管理','name'=>'kaoshi','paixu' =>3,'ismenu' =>true,'font'=>''], ['id'=>4,'title' =>'师生名单','name'=>'renshi','paixu' =>4,'ismenu' =>true,'font'=>''], ['id'=>5,'title' =>'教务管理','name'=>'teach','paixu' =>5,'ismenu' =>true,'font'=>''], diff --git a/route/admin.php b/route/admin.php index 90729847..9c50b461 100644 --- a/route/admin.php +++ b/route/admin.php @@ -16,4 +16,5 @@ Route::resource('authrule','admin/AuthRule'); Route::resource('authgroup','admin/AuthGroup'); Route::get('resetpassword/:id','admin/Index/resetpassword'); Route::get('editpassword/:id/edit','admin/Index/editPassword'); -Route::put('editpassword/:id','admin/Index/updatePassword'); \ No newline at end of file +Route::put('editpassword/:id','admin/Index/updatePassword'); +Route::get('myinfo','admin/Index/myinfo'); \ No newline at end of file diff --git a/route/renshi.php b/route/renshi.php index 4d88e258..5131142c 100644 --- a/route/renshi.php +++ b/route/renshi.php @@ -14,6 +14,10 @@ Route::resource('teacher','renshi/Index'); Route::get('teacher/createall','renshi/Index/createAll'); // 定义GET请求路由规则 Route::post('teacher/createall','renshi/Index/saveAll'); // 定义POST请求路由规则 Route::post('srcteacher','renshi/Index/srcTeacher'); // 定义POST请求路由规则 +Route::post('srcry/:teacherid','renshi/Index/srcRy'); // 定义POST请求路由规则 +Route::post('srckt/:teacherid','renshi/Index/srcKt'); // 定义POST请求路由规则 + + Route::resource('student','renshi/Student'); Route::get('student/createall','renshi/Student/createAll'); // 定义GET请求路由规则
    姓名{$list.xingming}        {$list.quanpin}        {$list.shoupin}
    性别{$list.sex}
    出生日期{$list.shengri}        {$list.age}周岁
    参加工作时间{$list.worktime}        {$list.gongling}年工龄
    职务{$list.js_zhiwu.title}
    职称{$list.js_zhicheng.title}
    单位{$list.js_danwei.title}
    毕业院校{$list.biye}
    专业{$list.zhuanye}
    学历{$list.js_xueli.title}