修正关联定义的一些问题

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

@@ -273,7 +273,7 @@ class MorphMany extends Relation
*/
protected function baseQuery()
{
if (empty($this->baseQuery)) {
if (empty($this->baseQuery) && $this->parent->getData()) {
$pk = $this->parent->getPk();
$map[$this->morphKey] = $this->parent->$pk;
$map[$this->morphType] = $this->type;