This commit is contained in:
2021-02-22 10:08:29 +08:00
parent 0d77f82234
commit e3b9caab23
+4 -1
View File
@@ -228,8 +228,11 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
* @throws ReflectionException
* @throws Exception
*/
public static function findOne($param, $db = NULL): static
public static function findOne($param, $db = NULL): static|null
{
if (is_bool($param)) {
return null;
}
if (is_numeric($param)) {
$primary = static::getColumns()->getPrimaryKeys();
if (empty($primary)) {