public function type()
{
return $this->hasOne(ClothType::class, 'id', 'tid')->bind(['name'=>'typename']);
}return self::with('type')->find(77);返回的内容里面没有typename,也没name. 主表没有name字段,所以不存在冲突。
但是如果不用bind. 直接
return $this->hasOne(ClothType::class, 'id', 'tid')则返回结果就会有 $data['type'] 的数据