Skip to content

Commit 104c8ea

Browse files
author
idcpj
committed
修复一对一表不支持驼峰写法
1 parent cb000aa commit 104c8ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/model/relation/OneToOne.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ protected function match(string $model, string $relation, Model $result): void
274274
foreach ($result->getData() as $key => $val) {
275275
if (str_contains($key, '__')) {
276276
[$name, $attr] = explode('__', $key, 2);
277-
if ($name == $relation) {
278-
$list[$name][$attr] = $val;
277+
if ($name === strtolower($relation)) {
278+
$list[$relation][$attr] = $val;
279279
unset($result->$key);
280280
}
281281
}

0 commit comments

Comments
 (0)