【发布时间】:2017-01-30 20:20:48
【问题描述】:
我有这个代码
use Carbon;
$now = Carbon::now()->toDateString();
所以我得到了没有时间的日期
public funtion test($brandid){
$nbofsale=DB::table('st_nsales')
->where('brand_id', $brandid)
->where('eodate', $now)
->get();
return $nbofsale;
}
选择中的eodate 字段是日期时间。我只想将它作为日期放在此查询中,而不是更改数据库中的字段类型。
有什么想法吗?
【问题讨论】:
标签: php laravel php-carbon