updated rimo type map
This commit is contained in:
@@ -1837,17 +1837,15 @@ class PreorderController extends mfBaseController {
|
||||
}
|
||||
|
||||
public function RimoTypeMapAction() {
|
||||
$allowedCampaigns = Helper::getPreorderCampaignFromUser($this->me);
|
||||
$campaignId = $this->request->preordercampaign_id ?? null;
|
||||
if (!$campaignId || !in_array($campaignId, $allowedCampaigns)) {
|
||||
$this->layout()->setFlash("Ungültige oder keine Kampagne ausgewählt.", "warning");
|
||||
$this->redirect("Preorder", "Index");
|
||||
}
|
||||
|
||||
Helper::renderVue($this, "PreorderRimoTypeMap", "PreorderRimoTypeMap", [
|
||||
"MAPBOX_KEY" => TT_MAPBOX_TILE_API_TOKEN,
|
||||
"USER_ID" => $this->me->id,
|
||||
"ALL_USERS" => array_map(fn($u) => ["id" => $u->id, "name" => $u->name], UserModel::getAll())
|
||||
"ALL_USERS" => array_map(fn($u) => ["id" => $u->id, "name" => $u->name], UserModel::getAll()),
|
||||
"ALL_CAMPAIGNS" => array_map(fn($c) => ["id" => $c->id, "name" => $c->name], Helper::getPreorderCampaignFromUser($this->me, true)),
|
||||
"PATH" => [
|
||||
["text" => MFAPPNAME_SLUG, "href" => self::getUrl("Dashboard")],
|
||||
["text" => "Rimo Typen Karte", "href" => self::getUrl("Preorder/RimoTypeMap")]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1359,7 +1359,7 @@ ORDER BY
|
||||
h.id AS hausnummer_id, h.gps_lat, h.gps_long, h.rimo_type, h.rimo_op_state, h.rimo_ex_state, h.hausnummer,
|
||||
s.name AS strasse_name, plz.plz AS plz_name, o.name AS ortschaft_name, h.rimo_id,
|
||||
COUNT(DISTINCT we.id) AS wohneinheit_count,
|
||||
COUNT(DISTINCT ps.id) AS preorder_count
|
||||
COUNT(DISTINCT pr.id) AS preorder_count
|
||||
FROM `{$addressDbName}`.`Hausnummer` AS h
|
||||
LEFT JOIN `{$addressDbName}`.`Wohneinheit` AS we ON h.id = we.hausnummer_id
|
||||
LEFT JOIN `{$fronkDbName}`.`Preorder` AS pr ON we.id = pr.adb_wohneinheit_id AND pr.preordercampaign_id = {$safeCampaignId} AND pr.deleted = 0
|
||||
|
||||
Reference in New Issue
Block a user