gpt4 book ai didi

php - 如何在 Laravel 5.2 中编写 >= Eloquent 数据库查询

转载 作者:可可西里 更新时间:2023-11-01 00:56:51 26 4
gpt4 key购买 nike

我正在尝试在 laravel 5.2 中触发 Eloquent 查询

  Movies_showtimes::with('showdata','movie','cinema')->where(['cinema_id'=>$id,'show_date'=>Carbon::today()])->get();

此查询仅获取今天日期的所有电影放映时间。我想获取今天 >= 的电影放映时间,但我无法在上述查询的 where() 子句中放入 >= 符号。

感谢您的帮助。我试过这样做,但对我没有用

  Movies_showtimes::with('showdata','movie','cinema')->where(['cinema_id'=>$id,'show_date','>=',Carbon::today()])->get();

最佳答案

试试这个查询

Movies_showtimes::with('showdata','movie','cinema')->where(
[['cinema_id','=',$id],['show_date','>=',Carbon::today()]]
)->get();

关于php - 如何在 Laravel 5.2 中编写 >= Eloquent 数据库查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39586053/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com