easy-swoole / orm

31 stars 27 forks source link

联合主键下 destroy update 条件错误 #166

Closed PlmBest closed 4 years ago

PlmBest commented 4 years ago

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

orm 1.4.21 easyswoole 3.3.7

问题描述和截图 [Question]

联合主键的情况下 destroy 会错误 删除 以第一个主键为条件的所有记录 0(D(1EJYV 9W{1J2@}HIHKG

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

$test = TestModel::create()->where('pk_1', 1)->where('pk_2', 2)->get(); $num = $test->destroy(); return $this->mResponse($num); 结果:$num = 3 ,会删除 所有pk_1 = 1 的记录

$test = TestModel::create()->where('pk_1', 1)->where('pk_2', 2)->get(); $test->status = 2; $test->update(); return $this->mResponse(); 结果:所有pk_1 = 1的status 全部被更改成2