diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index 44561f15..462cbc2a 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -42,7 +42,11 @@ class Index extends Base //得到排序字段的下标 $order_column = $getdt['order'][0]['column']; //根据排序字段的下标得到排序字段 - $order_field = $getdt['columns'][$order_column]['data']; + $order_field = $getdt['columns'][$order_column]['name']; + if($order_field=='') + { + $order_field = $getdt['columns'][$order_column]['data']; + } //得到limit参数 $limit_start = $getdt['start']; $limit_length = $getdt['length']; @@ -52,8 +56,11 @@ class Index extends Base //查询数据 - $data = AD::field('id,xingming,sex,username,phone,shengri,denglucishu,status,create_time') + $data = AD::field('id,school,xingming,sex,username,phone,shengri,denglucishu,status,create_time') ->where('id','>','2') + ->with(['adSchool'=>function($query){ + $query->field('id,jiancheng'); + }]) ->order([$order_field=>$order]) ->limit($limit_start,$limit_length) ->select(); @@ -63,8 +70,11 @@ class Index extends Base // 如果需要查询 if($search){ - $data = AD::field('id,xingming,sex,username,phone,shengri,denglucishu,status,create_time') + $data = AD::field('id,school,xingming,sex,username,phone,shengri,denglucishu,status,create_time') ->where('id','>','1') + ->with(['adSchool'=>function($query){ + $query->field('jiancheng'); + }]) ->order([$order_field=>$order]) ->limit($limit_start,$limit_length) ->where('username|xingming','like','%'.$search.'%') @@ -116,7 +126,7 @@ class Index extends Base // 获取表单数据 - $list = request()->only(['xingming','username','sex','shengri','phone','beizhu','group_id'],'post'); + $list = request()->only(['xingming','school','username','sex','shengri','phone','beizhu','group_id'],'post'); // 设置密码,默认为123456 @@ -158,7 +168,7 @@ class Index extends Base { // 获取管理员信息 - $list = AD::get($id); + $list = AD::where('id',$id)->find(); // 模板赋值 $this->assign('list',$list); @@ -175,8 +185,9 @@ class Index extends Base { // 获取用户信息 - $list = AD::field('id,username,xingming,sex,shengri,phone,beizhu') - ->get($id); + $list = AD::where('id',$id) + ->field('id,school,username,xingming,sex,shengri,phone,beizhu') + ->find(); // 追加用户id字符串 $list = $list->append(['groupids']); @@ -195,7 +206,7 @@ class Index extends Base $validate = new \app\admin\validate\Admin; // 获取表单数据 - $list = request()->only(['xingming','username','sex','shengri','phone','beizhu','group_id'],'put'); + $list = request()->only(['xingming','school','username','sex','shengri','phone','beizhu','group_id'],'put'); // 验证表单数据 $result = $validate->check($list); diff --git a/application/admin/model/Admin.php b/application/admin/model/Admin.php index 9c41b543..f021d2e0 100644 --- a/application/admin/model/Admin.php +++ b/application/admin/model/Admin.php @@ -45,6 +45,13 @@ class Admin extends Base } + // 最后登录获取器 + public function getLasttimeAttr($value) + { + return date('Y年m月d日 h:i:s',$value); + } + + // 权限关联 public function authgroup() { @@ -91,6 +98,12 @@ class Admin extends Base return $str; } + // 单位关联模型 + public function adSchool() + { + return $this->belongsTo('\app\system\model\School','school','id'); + } + } diff --git a/application/admin/view/index/create.html b/application/admin/view/index/create.html index 4fc7eaec..51ad007a 100644 --- a/application/admin/view/index/create.html +++ b/application/admin/view/index/create.html @@ -13,6 +13,20 @@ +
欢迎使用{$list.title} v{$list.version}!
-登录次数:{$list.denglucishu}
-上次登录IP:222.35.131.79.1 上次登录时间:2014-6-14 11:19:55
-| 信息统计 | -||||||
|---|---|---|---|---|---|---|
| 统计 | -资讯库 | -图片库 | -产品库 | -用户 | -管理员 | -|
| 总数 | -92 | -9 | -0 | -8 | -20 | -|
| 今日 | -0 | -0 | -0 | -0 | -0 | -|
| 昨日 | -0 | -0 | -0 | -0 | -0 | -|
| 本周 | -2 | -0 | -0 | -0 | -0 | -|
| 本月 | -2 | -0 | -0 | -0 | -0 | -|
登录次数:{$list.denglu.denglucishu}
+上次登录IP:{$list.denglu.lastip} 上次登录时间:{$list.denglu.lasttime}
+如果需要帮助,请单击左上角“成绩统计”
| 服务器计算机名 | -http://127.0.0.1/ | -||
|---|---|---|---|
| ThinkPhp版本号 | +ThinkPhp版本号 | {$Think.version} | |
| 服务器IP地址 | -192.168.1.1 | +{$list.server.SERVER_ADDR} | |
| 服务器域名 | -www.h-ui.net | +{$list.server.HTTP_REFERER} | |
| 服务器端口 | -80 | +{$list.server.SERVER_PORT} | |
| 服务器IIS版本 | -Microsoft-IIS/6.0 | -||
| 本文件所在文件夹 | -D:\WebSite\HanXiPuTai.com\XinYiCMS.Web\ | -||
| 服务器操作系统 | -Microsoft Windows NT 5.2.3790 Service Pack 2 | +服务器版本 | +{$list.server.SERVER_SOFTWARE} |
| 系统所在文件夹 | -C:\WINDOWS\system32 | +{$list.env.ROOT_PATH} | |
| 服务器脚本超时时间 | -30000秒 | +3600秒 | +|
| 缓存超时时间 | +3天 | ||
| 服务器的语言种类 | -Chinese (People's Republic of China) | -||
| .NET Framework 版本 | -2.050727.3655 | -||
| 服务器当前时间 | -2014-6-14 12:06:23 | +{$list.yuyan} | |
| 服务器IE版本 | -6.0000 | -||
| 服务器上次启动到现在已运行 | -7210分钟 | -||
| 逻辑驱动器 | -C:\D:\ | -||
| CPU 总数 | -4 | -||
| CPU 类型 | -x86 Family 6 Model 42 Stepping 1, GenuineIntel | -||
| 虚拟内存 | -52480M | -||
| 当前程序占用内存 | -3.29M | -||
| Asp.net所占内存 | -51.46M | -||
| 当前Session数量 | -8 | -||
| 当前SessionID | -gznhpwmp34004345jz2q3l45 | -||
| 当前系统用户名 | -NETWORK SERVICE | +IE 11.0 |