Skip to content

Commit 4432a92

Browse files
committed
Fixing mysql bug again with a where
1 parent c76f4a3 commit 4432a92

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Doctrine/ORM/ChannelPricingRepositoryTrait.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ public function resetMultiplier(DateTimeInterface $dateTime, string $bulkIdentif
3030
$qb = $this->createQueryBuilder('o');
3131
$ids = $qb
3232
->select('o.id')
33-
->andWhere('o.bulkIdentifier != :bulkIdentifier') // this ensures that the loop we are in doesn't turn into an infinite loop
33+
// this ensures that the loop we are in doesn't turn into an infinite loop
34+
->andWhere(
35+
$qb->expr()->orX(
36+
'o.bulkIdentifier != :bulkIdentifier',
37+
'o.bulkIdentifier is null'
38+
)
39+
)
3440
->andWhere(
3541
$qb->expr()->orX(
3642
// if the multiplier is different from 1 we know that it was discounted before, and we reset it
@@ -207,6 +213,7 @@ public function updatePrices(string $bulkIdentifier): void
207213
->createQueryBuilder('o')
208214
->update()
209215
->set('o.bulkIdentifier', ':null')
216+
->set('o.appliedPromotions', ':null')
210217
->andWhere('o.id IN (:ids)')
211218
->setParameter('null', null)
212219
->setParameter('ids', $ids)

0 commit comments

Comments
 (0)