easy-swoole / orm

31 stars 27 forks source link

查询时带上字段然后使用QueryBuilder::dec自减生成的sql不是自减的 #194

Closed 1551820051 closed 5 months ago

1551820051 commented 3 years ago

easyswoole框架版本号、orm组件版本号 [Version]

easyswoole 3.4.1 orm dev-master

问题描述和截图 [Question]

截屏2020-12-12 下午6 54 01

排查情况和最小复现脚本 [Tests and Recurrence]

$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