Closed PlmBest closed 4 years ago
orm 1.4.21 easyswoole 3.3.7
联合主键的情况下 destroy 会错误 删除 以第一个主键为条件的所有记录
$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();
$num = $test->destroy();
return $this->mResponse($num);
$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
$test->status = 2;
$test->update();
return $this->mResponse();
easyswoole框架版本号、orm组件版本号 [Version]
orm 1.4.21 easyswoole 3.3.7
问题描述和截图 [Question]
联合主键的情况下 destroy 会错误 删除 以第一个主键为条件的所有记录
排查情况和最小复现脚本 [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