Answer the question
In order to leave comments, you need to log in
Yii2 How to do batchInsert with ON DUPLICATE KEY UPDATE?
yii\db\Command batchInsert( $table, $columns, $rows ) does not imply padding.
Tell me how to add to the request at the end
ON DUPLICATE KEY UPDATE
`price_current` = 7,
`price_old` = 2
Answer the question
In order to leave comments, you need to log in
So far I see only one crutch option
Form an array for batchInsert -> copy it to a string using getRawSql -> add a condition to the string and execute the command through new sql
specially made behavior for this https://github.com/kozhemin/yii2-insert-update-behavior
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question