$test = TestModel::create()->field('id,money')->get(1);
$test->money = QueryBuilder::dec(1);
$test->update();
//SQL UPDATE test SET money = 99 WHERE id = 1
$test = TestModel::create()->field('id')->get(1);
$test->money = QueryBuilder::dec(1);
$test->update();
//SQL UPDATE `test` SET `money` = money-1 WHERE `id` = 1
easyswoole框架版本号、orm组件版本号 [Version]
easyswoole 3.4.1 orm dev-master
问题描述和截图 [Question]
排查情况和最小复现脚本 [Tests and Recurrence]
$test = TestModel::create()->field('id,money')->get(1); $test->money = QueryBuilder::dec(1); $test->update(); //SQL UPDATE
test
SETmoney
= 99 WHEREid
= 1