Hausnummer Frigabe is own table now

This commit is contained in:
Frank Schubert
2022-10-12 17:41:03 +02:00
parent 192e1323df
commit 58ff523492
10 changed files with 221 additions and 16 deletions

View File

@@ -0,0 +1,29 @@
#!/usr/bin/php
<?php
//require 'vendor/autoload.php';
require("../../config/config.php");
define('FRONKDB_SQLDEBUG',false);
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
$me = new User(1);
foreach(ADBHausnummerModel::search(['netzgebiet_id' => [1,2]]) as $hausnummer) {
foreach(['interest','provision','order','reorder'] as $type) {
$freigabe = ADBHausnummerFreigabeModel::getFirst(['hausnummer_id' => $hausnummer->id, 'freigabe' => $type]);
if(!$freigabe) {
$freigabe = ADBHausnummerFreigabeModel::create([
'hausnummer_id' => $hausnummer->id,
'freigabe' => $type
]);
if(!$freigabe->save()) {
die("Error saving HausnummerFreigabe (".$hausnummer->id.", $type)\n");
}
}
}
}