Task: Refactor contingent calculation logic
This commit is contained in:
@@ -84,17 +84,15 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa
|
||||
$dates[$row['date']] = [
|
||||
'status' => Contingent::STATUS_OK,
|
||||
'date' => $row['date'],
|
||||
'minPrice' => $row['minPrice'],
|
||||
'pax' => $row['pax'],
|
||||
'available' => $row['available'],
|
||||
'pax' => 0,
|
||||
'available' => 0,
|
||||
];
|
||||
} else {
|
||||
if ($row['status'] !== Contingent::STATUS_OK) {
|
||||
$dates[$row['date']]['status'] = $row['status'];
|
||||
}
|
||||
$dates[$row['date']]['pax'] += $row['pax'];
|
||||
$dates[$row['date']]['available'] += $row['available'];
|
||||
}
|
||||
if ($row['status'] !== Contingent::STATUS_OK) {
|
||||
$dates[$row['date']]['status'] = $row['status'];
|
||||
}
|
||||
$dates[$row['date']]['pax'] += $row['pax'];
|
||||
$dates[$row['date']]['available'] += $row['available'];
|
||||
}
|
||||
|
||||
$events = [];
|
||||
|
||||
Reference in New Issue
Block a user