Heim  >  Artikel  >  Backend-Entwicklung  >  yii2 关联表更新多个字段

yii2 关联表更新多个字段

WBOY
WBOYOriginal
2016-06-06 20:10:491685Durchsuche

有两张表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 关联表更新多个字段

俩字段用外键关联即可

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn