fix clear and copy week
This commit is contained in:
@@ -457,15 +457,15 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
public function consumeReservationCount($count){
|
||||
$newReservationCount = $this->reservation_count + $count;
|
||||
if ( $newReservationCount > $this->max_reservation_count ){
|
||||
throw new HttpException(406,"Max ticket seat count exceeded",EventRegistrationManager::MAX_SEAT_COUNT_EXCEEDED);
|
||||
throw new HttpException(406, 'Max ticket seat count exceeded',EventRegistrationManager::MAX_SEAT_COUNT_EXCEEDED);
|
||||
}
|
||||
$this->reservation_count = $newReservationCount;
|
||||
}
|
||||
|
||||
public function restoreReservationCount($usagesToRestore){
|
||||
$this->reservation_count = $this->reservation_count - $usagesToRestore;
|
||||
if ( $this->usage_count < 0 ){
|
||||
$this->usage_count = 0;
|
||||
$this->reservation_count -= $usagesToRestore;
|
||||
if ( $this->reservation_count < 0 ){
|
||||
$this->reservation_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user