【问题标题】:yii2 find values between two timestampsyii2 查找两个时间戳之间的值
【发布时间】:2017-08-23 09:19:09
【问题描述】:

我尝试的是查询两个日期之间创建的订单

所以我有

$maxdate = ; //timestamp value
$mindate = ; //timestamp value   


$orders = Orders::find()->where(["created_at" ..]) //stuck hre

正常的话是

find where created_at is between $maxdate and $mindate

我该怎么办?

【问题讨论】:

标签: php yii2


【解决方案1】:

你可以通过这个实现你的目标

$orders = Orders::find()->where(["between", "created_at", $mindate, $maxdate])

This is the fully reference about building various of Queries

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-12
    • 1970-01-01
    • 1970-01-01
    • 2017-12-21
    • 2020-07-13
    • 2021-09-09
    • 2022-12-20
    • 2014-01-28
    相关资源
    最近更新 更多