mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进hasWhere查询的数据重复问题
This commit is contained in:
@@ -97,6 +97,7 @@ class BelongsTo extends OneToOne
|
||||
}
|
||||
return $this->parent->db()->alias($model)
|
||||
->field($model . '.*')
|
||||
->group($model . '.' . $this->foreignKey)
|
||||
->join($table . ' ' . $relation, $model . '.' . $this->foreignKey . '=' . $relation . '.' . $this->localKey, $this->joinType)
|
||||
->where($where);
|
||||
}
|
||||
|
||||
@@ -271,6 +271,7 @@ class HasMany extends Relation
|
||||
}
|
||||
return $this->parent->db()->alias($model)
|
||||
->field($model . '.*')
|
||||
->group($model . '.' . $this->localKey)
|
||||
->join($table . ' ' . $relation, $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey)
|
||||
->where($where);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user