diff --git a/library/think/Model.php b/library/think/Model.php index 6fc8cabe..9394421a 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -838,6 +838,17 @@ abstract class Model implements \JsonSerializable, \ArrayAccess return json_encode($this->toArray(), $options); } + /** + * 移除当前模型的关联属性 + * @access public + * @return $this + */ + public function removeRelation() + { + $this->relation = []; + return $this; + } + /** * 转换当前模型数据集为数据集对象 * @access public