customerapi: on cancel check also registration ownership
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user