laravel雄辩的内在加入其中,其中来自另一个表的多个数据返回属性作为数组
假设,我有两张桌子。面表和表格。对于Tablea单行ID,TableB中有多个行。
现在,我想要所有的表面数据,包括表格,这是通过ID(tablea-> id ====)匹配的tableb-> blood_request_id)
退货将为
[
...tableA data,
'blood_request_id' => [1, 2]
]
Suppose, I have two tables; tableA and tableB. For tableA single row's id there are multiple rows in tableB.
Now I want all tableA data including tableB, that's matches by id (tableA->id === tableB->blood_request_id)
The return will be
[
...tableA data,
'blood_request_id' => [1, 2]
]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论