改进Model类

This commit is contained in:
thinkphp
2016-05-14 20:54:22 +08:00
parent 433726556f
commit 00b17411b6
2 changed files with 32 additions and 30 deletions

View File

@@ -1077,7 +1077,7 @@ class Query
/** @var Relation $model */
$model = $class->$relation();
$info = $class->getRelationInfo();
$info = $model->getRelationInfo();
if (in_array($info['type'], [Relation::HAS_ONE, Relation::BELONGS_TO])) {
if (0 == $i) {
$name = Loader::parseName(basename(str_replace('\\', '/', $currentModel)));