mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进一对一关联
This commit is contained in:
@@ -114,6 +114,16 @@ class MorphTo extends Relation
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除关联查询参数
|
||||
* @access public
|
||||
* @return $this
|
||||
*/
|
||||
public function removeOption()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 预载入关联查询
|
||||
* @access public
|
||||
|
||||
@@ -194,7 +194,9 @@ abstract class OneToOne extends Relation
|
||||
*/
|
||||
public function getEagerlyType()
|
||||
{
|
||||
$this->removeOption();
|
||||
if (0 == $this->eagerlyType) {
|
||||
$this->removeOption();
|
||||
}
|
||||
return $this->eagerlyType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user