Skip to content

Commit a72951e

Browse files
authored
fix isRedeemed when no speakers assigned (#230)
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 7fbaf69 commit a72951e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/Models/Foundation/Summit/Registration/PromoCodes/Traits/SpeakersPromoCodeTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,11 @@ public function isEmailSent():bool
306306
public function isRedeemed():bool
307307
{
308308
try {
309+
if(!$this->owners->count()) return false;
310+
309311
$query = $this->createQuery("SELECT COUNT(e.id) from models\summit\AssignedPromoCodeSpeaker e
310312
JOIN e.registration_promo_code pc
311-
WHERE pc.id = :promo_code_id and e.redeemed is null");
313+
WHERE pc.id = :promo_code_id AND e.redeemed is null");
312314

313315
$query->setParameter('promo_code_id', $this->getId());
314316
$res = $query->getSingleScalarResult();

0 commit comments

Comments
 (0)