## 时间和区间
- 时间:在设置的时候是单个时间设置,搜索时是区间搜索
- 区间:设置数字的时候为单个设置,搜索时是区间搜索
#### 示例效果:路径/ht/between
![](/static/plugins/tphp/backstage/example/list_time_between/menu.png)
数据设置
```
<?php
return [
'type' => 'sql',
'method' => 'list',
'config' => [
'table' => 'between'
],
];
```
列表设置
```
<?php
return [
'field' => [
'id' => [
'width' => 30,
'fixed' => true
],
'time_int' => ['type' => 'time', 'search' => true], // 字段time_int 为int类型,自动转化为时间戳
'time_str' => ['type' => 'time', 'search' => true], // 字段time_str 为字符串类型,按原样显示
'num' => ['type' => 'between', 'search' => true] // 类型between搜索时为区间搜索,一般情况下字段为数字类型,否则不能正常显示区间
],
'handle' => [
'time_int',
'time_str',
'num'
],
'handleinfo' => [
'ismax' => true
],
'is' => [
'add' => true,
'delete' => true
]
];
```
数据库设置
![](/static/plugins/tphp/backstage/example/list_time_between/table.png)
生成数据列表
![](/static/plugins/tphp/backstage/example/list_time_between/table2.png)
点击:后台模块 > 时间和区间
![](/static/plugins/tphp/backstage/example/list_time_between/demo.gif)