easy-swoole / orm

31 stars 27 forks source link

处理查询条件时没有兼容主键可能是 string 类型的数字,可能导致清表 #212

Closed browningweb closed 2 years ago

browningweb commented 2 years ago

https://github.com/easy-swoole/orm/blob/10157285f718caf1f27e3488b5aadaf5b2dc8e57/src/Utility/PreProcess.php#L19

is_int($whereVal) 判断能否改成 is_numeric($whereVal),因为有时忘记类型转换,主键的值可能是 string 类型的,导致删除数据的时候没有条件,直接清表了。

XueSiLf commented 2 years ago

目前已经修复,#214,等待发布下1个版本