37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
#!/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);
|
|
define("INTERNAL_USER_ID", $me->id);
|
|
define("INTERNAL_USER_USERNAME", $me->username);
|
|
define("MFBASE_BYPASS_LOGIN", true);
|
|
|
|
$db = new FronkDB();
|
|
|
|
$sql = "SELECT oaid, count(oaid) as anzahl FROM `Preorder`
|
|
LEFT JOIN Preordercampaign on (Preordercampaign.id = Preorder.preordercampaign_id)
|
|
LEFT JOIN Preorderstatus ON (Preorder.status_id = Preorderstatus.id)
|
|
WHERE Preorderstatus.code < 899 AND deleted = 0
|
|
GROUP BY oaid HAVING anzahl > 1";
|
|
|
|
$res = $db->query($sql);
|
|
while($oaid_data = $db->fetch_object($res)) {
|
|
$oaid = $oaid_data->oaid;
|
|
|
|
$unit_count = ADBWohneinheitModel::count(["oaid" => $oaid]);
|
|
if($unit_count < 2) {
|
|
continue;
|
|
echo "nur eine einheit\n";
|
|
}
|
|
echo "$oaid\n";
|
|
} |