使用Laravel Eloquent模型时出现错误,我的数据库时间戳字段为2018-02-09 12:55:06.1234,当我在此使用Carbon时,我会得到以下JSON中的尾随数据错误。如何修复它。
{
"draw": 1,
"recordsTotal": 641,
"recordsFiltered": 0,
"data": [],
"error": "Exception Message:\n\nTrailing data"
}
使用Laravel Eloquent模型时出现错误,我的数据库时间戳字段为2018-02-09 12:55:06.1234,当我在此使用Carbon时,我会得到以下JSON中的尾随数据错误。如何修复它。
{
"draw": 1,
"recordsTotal": 641,
"recordsFiltered": 0,
"data": [],
"error": "Exception Message:\n\nTrailing data"
}
我只需要截取created_at
字段中的秒数。这是我的代码:
update mrlpay.terminals set created_at=date_trunc('seconds', created_at);