代码:
public function index()
{
$result = Db::name('user')
->where('id',15)
->update([
'create_time'=>['exp','now()'],
'update_time'=>['exp','create_time+1'],
]);
return $result;
}
错误提示:
不支持的数据表达式:[exp]

修改:
1. Db::table('think_user')
2. ->where('id', 1)
3. ->update([
4. 'login_time' => Db::raw('now()'),
5. 'login_times' => Db::raw('login_times+1'),
6. ]);