【发布时间】:2020-01-10 15:06:17
【问题描述】:
我在 Laravel 5.2 中收到以下错误
以下是查询:
$ansrow = DB::table('answers')
->where('user_id', $u_id)
->whereBetween('created_at', [
now()->format('Y-m-d H:00:00'),
now()->addHours(1)->format('Y-m-d H:00:00')
])
->first();
我收到以下错误:
Call to undefined function App\Http\Controllers\now()
【问题讨论】:
-
PHP 中没有
now()。您可以按照链接stackoverflow.com/questions/1995562/now-function-in-php/1995566中提到的方式进行操作