This commit is contained in:
thinkphp
2017-10-23 11:52:30 +08:00
parent 4d131bb3e5
commit ba9efa867f
2 changed files with 3 additions and 3 deletions

View File

@@ -1998,7 +1998,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
$trace = debug_backtrace(false, 2);
$morph = Loader::parseName($trace[1]['function']);
}
$type = $type ?: Loader::parseName($this->name);
$type = $type ?: get_class($this);
if (is_array($morph)) {
list($morphType, $foreignKey) = $morph;
} else {
@@ -2024,7 +2024,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
$trace = debug_backtrace(false, 2);
$morph = Loader::parseName($trace[1]['function']);
}
$type = $type ?: Loader::parseName($this->name);
$type = $type ?: get_class($this);
if (is_array($morph)) {
list($morphType, $foreignKey) = $morph;
} else {