修正关联定义的一些问题

This commit is contained in:
thinkphp
2017-04-24 13:58:59 +08:00
parent 77dbb1315b
commit aebbf980a5
4 changed files with 6 additions and 6 deletions

View File

@@ -128,7 +128,7 @@ class HasManyThrough extends Relation
*/
protected function baseQuery()
{
if (empty($this->baseQuery)) {
if (empty($this->baseQuery) && $this->parent->getData()) {
$through = $this->through;
$model = $this->model;
$alias = Loader::parseName(basename(str_replace('\\', '/', $model)));