doudeng3008 2017-04-21 09:49
浏览 46
已采纳

在三个表中将这个laravel5.4雄辩的关系命名为

I studied eloquent relationships in laravel, i love to use them but today am confuse about relation the following three tables has. I have a relation between three tables like:

1) companies   {id, company_name}
2) screens     {id, screen_name}
3) company_screen   {id, company_id, screen_id, connected[yes/no] }

what type of relation is this in laravel? how can i fetch screens which are connected(yes), for a company?

  • 写回答

1条回答 默认 最新

  • duanchen7036 2017-04-21 10:01
    关注

    after posting my question i read many to many relation in https://laravel.com/docs/5.4/eloquent-relationships#updating-many-to-many-relationships it's just many to many relation with and extra column in pivot table.

    thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?