Merge branch 'fix-new-dashboard' into 'master'
updated rml dashboard See merge request fronk/thetool!914
This commit is contained in:
@@ -168,27 +168,64 @@ class DashboardNewController extends mfBaseController {
|
||||
PreorderModel::countActive($params);
|
||||
};
|
||||
|
||||
|
||||
$baufortschritt_140 = $countFunction([">status_code" => "139", "<status_code" => "899"]);
|
||||
$timeline_baufortschritt_140 = $this->getTimeline('weekly-leerrohr', $campaign_ids, $gemeinde_ids);
|
||||
|
||||
$ont_installiert_300 = $countFunction([">status_code" => "299", "<status_code" => "899"]);
|
||||
$timeline_ont_installiert_300 = $this->getTimeline('weekly-ont-installed', $campaign_ids, $gemeinde_ids);
|
||||
|
||||
$baufortschritt_140_base_value_before_history = $baufortschritt_140 - $timeline_baufortschritt_140[0][count($timeline_baufortschritt_140[0]) - 1]['value'];
|
||||
|
||||
foreach ($timeline_baufortschritt_140[0] as $key => $value) {
|
||||
$timeline_baufortschritt_140[0][$key]['value'] += $baufortschritt_140_base_value_before_history;
|
||||
}
|
||||
|
||||
|
||||
$ont_installiert_300 = $countFunction([">status_code" => "299", "<status_code" => "899"]);
|
||||
$timeline_ont_installiert_300 = $this->getTimeline('weekly-ont-installed', $campaign_ids, $gemeinde_ids);
|
||||
$ont_installiert_300_base_value_before_history = $ont_installiert_300 - $timeline_ont_installiert_300[0][count($timeline_ont_installiert_300[0]) - 1]['value'];
|
||||
|
||||
foreach ($timeline_ont_installiert_300[0] as $key => $value) {
|
||||
$timeline_ont_installiert_300[0][$key]['value'] += $ont_installiert_300_base_value_before_history;
|
||||
}
|
||||
|
||||
if ($this->me->address_id === '4807') {
|
||||
|
||||
self::returnJson([
|
||||
'type' => 'rml',
|
||||
'order_max_home_addrdb' => $order_max_homes,
|
||||
'order_actual_order' => $countFunction([]),
|
||||
'order_energie_steiermark' => $countFunction(["partner_id" => [20,5033, 3151, 7685, 7754, 7764]]),
|
||||
'order_magenta' => $countFunction(["partner_id" => 4803]),
|
||||
'order_salzburg_ag' => $countFunction(["partner_id" => 5668]),
|
||||
'baufortschritt_140' => $baufortschritt_140,
|
||||
|
||||
// MAYBE OVERWORK
|
||||
'order_efh' => $countFunction(["connection_type" => $efh_connection_types]),
|
||||
'installationspaket_erhalten' => $countFunction(["connection_type" => $efh_connection_types], 145),
|
||||
'lehrrohr_im_haus' => $countFunction(["connection_type" => $efh_connection_types], 200),
|
||||
//END MAYBE OVERWORK
|
||||
'inhouse_kabel_verlegt_efh' => $countFunction([">status_code" => "243", "<status_code" => "899"]),
|
||||
'inhouse_kabel_verlegt_efh_magenta' => $countFunction([">status_code" => "243", "<status_code" => "899", "partner_id" => 4803]),
|
||||
'inhouse_kabel_verlegt_efh_salzburg' => $countFunction([">status_code" => "243", "<status_code" => "899", "partner_id" => 5668]),
|
||||
'order_mph' => $countFunction(["connection_type" => $mph_connection_types]),
|
||||
'inhouse_kabel_verlegt_mph' => $countFunction(["connection_type" => $mph_connection_types], 242),
|
||||
|
||||
'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids),
|
||||
'timeline_leerrohr' => $timeline_baufortschritt_140,
|
||||
'timeline_ont_installed' => $timeline_ont_installiert_300,
|
||||
|
||||
// status 244 245 -
|
||||
'status_244_245_energie_steiermark' => $countFunction(["partner_id" => [20,5033, 3151, 7685, 7754, 7764], ">status_code" => "243", "<status_code" => "899"]),
|
||||
'status_244_245_magenta' => $countFunction(["partner_id" => 4803, ">status_code" => "243", "<status_code" => "899"]),
|
||||
'status_244_245_salzburg_ag' => $countFunction(["partner_id" => 5668, ">status_code" => "243", "<status_code" => "899"]),
|
||||
'status_500_energy_steiermark' => $countFunction(["partner_id" => [20,5033, 3151, 7685, 7754, 7764], "status_code" => "500"]),
|
||||
'status_500_magenta' => $countFunction(["partner_id" => 4803, "status_code" => "500"]),
|
||||
'status_500_salzburg_ag' => $countFunction(["partner_id" => 5668, "status_code" => "500"]),
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
self::returnJson([
|
||||
'type' => 'default',
|
||||
'order_max_home_addrdb' => $order_max_homes,
|
||||
'order_actual_order' => $countFunction([]),
|
||||
'order_efh' => $countFunction(["connection_type" => $efh_connection_types]),
|
||||
@@ -210,9 +247,19 @@ class DashboardNewController extends mfBaseController {
|
||||
'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids),
|
||||
'timeline_leerrohr' => $timeline_baufortschritt_140,
|
||||
'timeline_ont_installed' => $timeline_ont_installiert_300
|
||||
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
//Installationsfortschritt Provider
|
||||
//
|
||||
|
||||
|
||||
// jasmin wegkommt
|
||||
// psc raaba 0316 67 33 00 zollweg michael (
|
||||
// zollweg michael
|
||||
|
||||
private function getTimeline($type, $campaign_ids, $gemeinde_ids) { //TODO: fix gemeinde
|
||||
$timeline = [];
|
||||
$baseParams = ["preordercampaign_id" => $campaign_ids, "gemeinde_id" => $gemeinde_ids];
|
||||
|
||||
Reference in New Issue
Block a user