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

Laravel这种关联模型怎么做?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:25:28
Original
1197 people have browsed it

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

Laravel这种关联模型怎么做?

回复内容:

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

Laravel这种关联模型怎么做?

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

Related labels:
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
Latest Issues
Composer cannot install laravel
From 1970-01-01 08:00:00
0
0
0
Laravel Space/laravel-backup cannot be installed
From 1970-01-01 08:00:00
0
0
0
Laravel 5.1 Login laravel comes with it No more
From 1970-01-01 08:00:00
0
0
0
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template