作者 杨育虎

2

1 <?php 1 <?php
2 2
3 return [ 3 return [
4 - 'Id' => 'ID',  
5 - 'Openid' => 'OPENID',  
6 - 'Token' => 'Token',  
7 - 'Nickname' => '微信名',  
8 - 'Avatar' => '头像' 4 + 'Id' => 'ID',
  5 + 'Openid' => 'OPENID',
  6 + 'Token' => 'Token',
  7 + 'Nickname' => '微信名',
  8 + 'Avatar' => '头像',
  9 + 'Createtime' => '注册时间',
  10 + 'Updatetime' => '最后登陆时间'
9 ]; 11 ];
@@ -16,11 +16,11 @@ class User extends Model @@ -16,11 +16,11 @@ class User extends Model
16 protected $name = 'user'; 16 protected $name = 'user';
17 17
18 // 自动写入时间戳字段 18 // 自动写入时间戳字段
19 - protected $autoWriteTimestamp = false; 19 + protected $autoWriteTimestamp = 'int';
20 20
21 // 定义时间戳字段名 21 // 定义时间戳字段名
22 - protected $createTime = false;  
23 - protected $updateTime = false; 22 + protected $createTime = 'createtime';
  23 + protected $updateTime = 'updatetime';
24 protected $deleteTime = false; 24 protected $deleteTime = false;
25 25
26 // 追加属性 26 // 追加属性
@@ -7,24 +7,24 @@ @@ -7,24 +7,24 @@
7 <div class="widget-body no-padding"> 7 <div class="widget-body no-padding">
8 <div id="toolbar" class="toolbar"> 8 <div id="toolbar" class="toolbar">
9 <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a> 9 <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
10 - <!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->  
11 - <!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->  
12 - <!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->  
13 - <!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('user/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>--> 10 + <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
  11 + <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
  12 + <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
  13 + <a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('user/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
14 14
15 - <!--<div class="dropdown btn-group {:$auth->check('user/multi')?'':'hide'}">-->  
16 - <!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->  
17 - <!--<ul class="dropdown-menu text-left" role="menu">-->  
18 - <!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>-->  
19 - <!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>-->  
20 - <!--</ul>-->  
21 - <!--</div>--> 15 + <div class="dropdown btn-group {:$auth->check('user/multi')?'':'hide'}">
  16 + <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
  17 + <ul class="dropdown-menu text-left" role="menu">
  18 + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
  19 + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
  20 + </ul>
  21 + </div>
22 22
23 23
24 </div> 24 </div>
25 <table id="table" class="table table-striped table-bordered table-hover table-nowrap" 25 <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
26 data-operate-edit="{:$auth->check('user/edit')}" 26 data-operate-edit="{:$auth->check('user/edit')}"
27 - data-operate-del="{:$auth->check('user/del')}" 27 + data-operate-del="{:$auth->check('user/del')}"
28 width="100%"> 28 width="100%">
29 </table> 29 </table>
30 </div> 30 </div>
@@ -26,11 +26,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -26,11 +26,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
26 [ 26 [
27 {checkbox: true}, 27 {checkbox: true},
28 {field: 'id', title: __('Id')}, 28 {field: 'id', title: __('Id')},
29 - // {field: 'openid', title: __('Openid'), operate: 'LIKE'},  
30 - // {field: 'token', title: __('Token'), operate: 'LIKE'}, 29 + {field: 'openid', title: __('Openid'), operate: 'LIKE'},
  30 + {field: 'token', title: __('Token'), operate: 'LIKE'},
31 {field: 'nickname', title: __('Nickname'), operate: 'LIKE'}, 31 {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
32 {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, 32 {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
33 - // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} 33 + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  34 + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  35 + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
34 ] 36 ]
35 ] 37 ]
36 }); 38 });