Updates Liezen Bulk Update script 2024

This commit is contained in:
Frank Schubert
2024-01-10 22:50:25 +01:00
parent 3611372669
commit 1d6da057a0

View File

@@ -96,8 +96,7 @@ while($csv = fgetcsv($input, 0, ",")) {
$existing_hausnummer = new ADBHausnummer($hausnummer_id);
if(!$existing_hausnummer->id) {
echo "$hausnummer_id not found\n";
continue;
die("$hausnummer_id not found\n");
}
//continue;
@@ -216,10 +215,18 @@ while($csv = fgetcsv($input, 0, ",")) {
$existing_hausnummer->grund_nr = $grund_nr;
}
if(in_array("gps_lat", $updates)) {
$existing_hausnummer->gps_lat = $gps_lat;
if(is_numeric($gps_lat)) {
$existing_hausnummer->gps_lat = $gps_lat;
} else {
$existing_hausnummer->gps_lat = null;
}
}
if(in_array("gps_long", $updates)) {
$existing_hausnummer->gps_long = $gps_long;
if(is_numeric($gps_long)) {
$existing_hausnummer->gps_long = $gps_long;
} else {
$existing_hausnummer->gps_long = null;
}
}
if(in_array("rollout", $updates) || in_array("rollout_info", $updates)) {
@@ -231,10 +238,14 @@ while($csv = fgetcsv($input, 0, ",")) {
$new_rollout = $rollout_time;
$new_rollout_info = null;
$freigabe = $freigabe_default;
} elseif($rollout_time == "2024/2025") {
} elseif($rollout_info == "2024/2025") {
$new_rollout = null;
$new_rollout_info = "2024/2025";
$freigabe = json_encode(['reorder']);
} elseif($rollout_info == "2025/2026") {
$new_rollout = null;
$new_rollout_info = "2025/2026";
$freigabe = json_encode(['reorder']);
} elseif($rollout_info == "2099") {
$new_rollout = null;
$new_rollout_info = "2099";