php 时间 t,时间和区间

## 时间和区间

- 时间:在设置的时候是单个时间设置,搜索时是区间搜索

- 区间:设置数字的时候为单个设置,搜索时是区间搜索

#### 示例效果:路径/ht/between

![](https://img.kancloud.cn/75/6f/756f5d25b9c90cf92051bd5ad599d369_634x289.png)

数据设置

~~~

return [

'type' => 'sql',

'config' => [

'table' => 'between'

],

];

~~~

列表设置

~~~

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

]

];

~~~

数据库设置

![](https://img.kancloud.cn/df/08/df0870bdb5caf3d2e9994017ce1569f0_939x118.png)

生成数据列表

![](https://img.kancloud.cn/cf/c7/cfc7a29b7733369a887ea12bb0bfe382_513x162.png)

点击:后台模块 > 时间和区间

![](https://img.kancloud.cn/5c/0a/5c0a07ac86771de3520e045213e7be66_1009x588.gif)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值