laravel 远程一对多实例
/** * 关联楼宇推荐书关联表 * 远程一对一 */ public function buildingPanos() { return $this->hasManyThrough( 'App\Building', // 远程表 'App\ModelList\BuildingPano', // 中间表 'pano_id', // 中间表对主表的关联字段 'id', // 远程表对中间表的关联字段 'pano_config_id', // 主表对中间表的关联字段 'building_id' // 中间表对远程表的关联字段 ); }
赞赏码
![](https://files.cnblogs.com/files/lxwphp/zhifubao2.bmp)
![](https://files.cnblogs.com/files/lxwphp/weixin.bmp)
非学,无以致疑;非问,无以广识