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