customerapi: on cancel check also registration ownership

This commit is contained in:
2021-10-07 08:09:16 +02:00
parent 89b3ab4ce5
commit b993f5dee0
5 changed files with 49 additions and 67 deletions

View File

@@ -122,29 +122,6 @@ class EventController extends \customerapi\controllers\CustomerApiController
]);
}
/**
* @param Query $query
* @param $interval
* @return Query the query with the added conditions
*/
private function buildEventQuery($query, $interval)
{
$paramEventStartMax = (clone $interval->lastActiveDate);
$paramEventStartMax = $paramEventStartMax->modify('+1 day');
$paramEventStartMax = $paramEventStartMax->getTimestamp();
/** @var ActiveQuery $query */
return $query
->innerJoinWith('trainer')
->innerJoinWith('eventType')
->innerJoinWith('room')
->joinWith('activeEventRegistrations')
->andWhere(['>=', 'event.start', $interval->firstActiveDate->getTimestamp()])
->andWhere(['<', 'event.start', $paramEventStartMax])
->andWhere(['event.active' => '1']);
}
/**
* @param integer $id_event the id of the event