Home > Backend Development > PHP Tutorial > Laravel这种关联模型怎么做?

Laravel这种关联模型怎么做?

WBOY
Release: 2016-06-06 20:25:28
Original
1165 people have browsed it

用户公司部门关联表 user_company_department_relation
使用belongsToMany 附加字段 只能对两个字段更新,不能3个字段多条

Laravel这种关联模型怎么做?

回复内容:

用户公司部门关联表 user_company_department_relation
使用belongsToMany 附加字段 只能对两个字段更新,不能3个字段多条

Laravel这种关联模型怎么做?

完全可以的,
belongsToMany
只是一个关系描述,
可以想成是 sql 语句拼接的一部分

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template