laravel - 如何使用模型从表中获取字段?
问题描述
示例表:
书
id|name
book_users
id|user_id|book_id|col_1|col_2
book_product
id|user_id|book_users_id|other_1|other_2
结果:
例如,对于用户 ID 1
书名 | book_users.col_1 | book_users.col_2
书名 | book_users.col_1 | book_users.col_2 | book_product.other_1 | book_product.other_2
帮帮我。
解决方案
推荐阅读
- javascript - .getBoundingClientRect()、each() 和 $(this) 之间的关系 - 获取循环中多个元素的 getBoundingClientRect
- javascript - 选择器解决为隐藏 - 剧作家和带显示:无。谁能知道如何使它工作?
- javascript - expressjs req.url 路径如何成为另一个url?
- mysql - 如何在 MySQL 数据库的存储过程中传递参数?
- hana - 如何从 HANA Studio 结果视图中删除行编号
- reactjs - 组件在本机反应中未正确重新渲染
- angular - 为 Angular i18n 编写单元测试
- javascript - 用于 Edge 的 Excel ActiveXObject 重新工具
- python - 成员消息角色名称时尝试分配 Discord 角色
- node-addon-api - Napi::Env 可以在子线程中使用吗?