时间查询
条件 | 方法 |
---|---|
当天 | whereDay(‘create_time’) |
昨天 | whereDay(‘create_time’, ‘yesterday’) |
某天 | whereDay(‘create_time’, ‘2018-06-01’) |
本周 | whereWeek(‘create_time’) |
上周 | whereWeek(‘create_time’, ‘last week’) |
某周 | whereWeek(‘create_time’, ‘2023-10-08’) |
本月 | whereMonth(‘create_time’) |
上月 | whereMonth(‘create_time’,‘last month’) |
某月 | whereMonth(‘create_time’, ‘2023-01’) |
本年 | whereYear(‘create_time’) |
去年 | whereYear(‘create_time’, ‘last year’) |
某年 | whereYear(‘create_time’, ‘2022’) |
最近15天 | whereTime(‘create_time’, ‘-15 days’) |