Updated rimo import script / preorder maint scripts
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<?php
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require("../config/config.php");
|
||||
require("../../config/config.php");
|
||||
|
||||
define('FRONKDB_SQLDEBUG',false);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||
@@ -18,10 +18,21 @@ define("INTERNAL_USER_USERNAME", $me->username);
|
||||
$ignore_preorders = [];
|
||||
|
||||
$campaign_prem_nord = 5;
|
||||
$campaign_prem_sued = 6;
|
||||
$campaign_gross_st_florian = 7;
|
||||
$campaign_kalwang = 41;
|
||||
|
||||
$selected_campaign = $campaign_kalwang;
|
||||
|
||||
if(!$selected_campaign) {
|
||||
echo "Keine Kampagne ausgewählt.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$same_unit_count = 0;
|
||||
|
||||
$i = 0;
|
||||
foreach(PreorderModel::search(['preordercampaign_id' => $campaign_prem_nord, 'adb_wohneinheit_id' => null, 'connection_count' => 1, "connection_type" => "single-dwelling", "deleted" => 0]) as $preorder) {
|
||||
foreach(PreorderModel::search(['preordercampaign_id' => $selected_campaign, 'adb_wohneinheit_id' => null, 'connection_count' => 1, "connection_type" => "single-dwelling", "deleted" => 0]) as $preorder) {
|
||||
if(in_array($preorder->id, $ignore_preorders)) continue;
|
||||
//if($preorder->connection_type != "single-dwelling") continue;
|
||||
|
||||
@@ -73,6 +84,7 @@ foreach(PreorderModel::search(['preordercampaign_id' => $campaign_prem_nord, 'ad
|
||||
ksort($unit_candidates, SORT_NUMERIC);
|
||||
$new_unit = array_shift($unit_candidates);
|
||||
$preorder->adb_wohneinheit_id = $new_unit->id;
|
||||
//var_dump($preorder, $new_unit);exit;
|
||||
$preorder->save();
|
||||
|
||||
echo "$i Wohneinheit saved\n";
|
||||
|
||||
Reference in New Issue
Block a user