tp6-更新数据时追加数据

旧数据:aaa,追加bbb,更新后为aaabbb

原生写法:

update 表名 set 字段名 = concat(字段名,"要增加的数据") where 条件值  

tp6写法:

TableName::update(['status' => 2, 'info' => \think\facade\Db::raw("concat(info,'bbb')")], ['id' => 1]);

猜你喜欢

转载自blog.csdn.net/I_lost/article/details/107261471