情景:修改order表的 pay_money 字段值 等于 total_price 字段的值;
问题:1. laravel 在模型中对字段类型有验证过滤,所以报错 Incorrect decimal value,如何绕过?
2. update中的具体写法?
Order::where(['id' => 1])->update (['order_status' => 5,'pay_money' => '`total_price`']);
General error: 1366 Incorrect decimal value: '`total_price`' for column 'pay_money' at row 1 (SQL: update `order` set `order_status` = 5, `pay_money` = `total_price`, `updated_at` = 2017-04-14 10:44:17 where id = 1