Skip to content

Commit

Permalink
修复一对一表不支持驼峰写法
Browse files Browse the repository at this point in the history
  • Loading branch information
idcpj committed Jun 7, 2024
1 parent 756a032 commit 99886f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model/relation/OneToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ protected function match(string $model, string $relation, Model $result): void
foreach ($result->getData() as $key => $val) {
if (str_contains($key, '__')) {
[$name, $attr] = explode('__', $key, 2);
if ($name == $relation) {
$list[$name][$attr] = $val;
if ($name === strtolower($relation)) {
$list[$relation][$attr] = $val;
unset($result->$key);
}
}
Expand Down

0 comments on commit 99886f4

Please sign in to comment.