Home  >  Article  >  Backend Development  >  yii2 关联表更新多个字段

yii2 关联表更新多个字段

WBOY
WBOYOriginal
2016-06-06 20:10:491631browse

有两张表account和user,其中account 表中有字段mobile,bind ,user表中也有mobile,和bind字段,account类和user类使用hasMany通过uid关联,在更新account表mobile.bind的时候,自动更新user表关联,请问,自动更新时能否更新user表中的mobile和bind

yii2 关联表更新多个字段

回复内容:

有两张表account和user,其中account 表中有字段mobile,bind ,user表中也有mobile,和bind字段,account类和user类使用hasMany通过uid关联,在更新account表mobile.bind的时候,自动更新user表关联,请问,自动更新时能否更新user表中的mobile和bind

yii2 关联表更新多个字段

俩字段用外键关联即可

Statement:
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