mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进
This commit is contained in:
@@ -833,6 +833,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
|
|
||||||
if (method_exists($modelRelation, 'getBindAttr')) {
|
if (method_exists($modelRelation, 'getBindAttr')) {
|
||||||
$bindAttr = $modelRelation->getBindAttr();
|
$bindAttr = $modelRelation->getBindAttr();
|
||||||
|
if ($bindAttr) {
|
||||||
foreach ($bindAttr as $key => $attr) {
|
foreach ($bindAttr as $key => $attr) {
|
||||||
$key = is_numeric($key) ? $attr : $key;
|
$key = is_numeric($key) ? $attr : $key;
|
||||||
if (isset($this->data[$key])) {
|
if (isset($this->data[$key])) {
|
||||||
@@ -841,9 +842,10 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
$item[$key] = $value ? $value->$attr : null;
|
$item[$key] = $value ? $value->$attr : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
$item[$name] = $value;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
$item[$name] = $value;
|
||||||
} else {
|
} else {
|
||||||
$item[$name] = $this->getAttr($name);
|
$item[$name] = $this->getAttr($name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user