我有以下代码来获取其术语今天结束的客户。
$customers = CompanyModel::where(("term_ending") ,"=", "CURDATE()")->get();
但是当我运行它时它返回null。
我在Mysql中运行的相同查询它给了我结果。
select * from `companies` where `term_ending` = CURDATE()
我在做什么错?
答案 0 :(得分:0)
我用碳来解决它。
$ customers = CompanyModel :: where((" term_ending")," =",Carbon :: today()) - > get();
谢谢:)