2016-12-16 2551 views
0

这不显示正确的计数。什么是正确的语法?Laravel - 小于/大于日期语法

$this->data['Tasks'] = \DB::table('tb_tasks')->where('Status', 'like', 'Open%')->whereDate('DeadLine', '>', 'CURDATE()')->count(); 
+1

的[Laravel雄辩的比较从时间字段日期]可能的复制(http://stackoverflow.com/questions/25139948/laravel-eloquent-compare-date -from-datetime-field) – manniL

回答

10

使用碳例如:

$this->data['Tasks'] = \DB::table('tb_tasks')->where('Status', 'like', 'Open%')->whereDate('DeadLine', '>', Carbon::now())->count(); 
+1

非常感谢。计数值现在是正确的。 – Selim

相关问题