Frameworks Yii2使用不同的条件更新许多记录

Frameworks Yii2使用不同的条件更新许多记录,frameworks,yii2,records,Frameworks,Yii2,Records,我想用yii2更新很多记录,以便插入使用batchinsert方法,而对于更新我不知道 update my_tbl set fld1 = 321321 where res = 46513, fld1 = 89876 where res = 54646, fld1 = 64564 where res = 54654; Yii2中没有bacthupdate函数 只有batchinsert可用 若需要,您可以迭代并更新命令,或者执行一系

我想用yii2更新很多记录,以便插入使用batchinsert方法,而对于更新我不知道

update my_tbl set fld1 = 321321 where res = 46513,
               fld1 = 89876 where res = 54646,  
               fld1 = 64564 where res = 54654;
Yii2中没有bacthupdate函数 只有batchinsert可用

若需要,您可以迭代并更新命令,或者执行一系列单独的更新,比如单独的命令

Yii2中实际上也提供了非结构化解决方案