Added banned FCPs to preordercampaign

This commit is contained in:
Frank Schubert
2023-10-18 13:42:32 +02:00
parent ac3685371f
commit cd22605b64
14 changed files with 720 additions and 7 deletions

View File

@@ -23,7 +23,7 @@ $log = mfLoghandler::singleton();
$input = fopen($filename, "r");
echo "order_id;cam_id;rml_order_code\n";
echo "order_id;cam_id;rml_order_code;rml_status\n";
$l = 0;
while($csv = fgetcsv($input, 0, ";")) {
@@ -38,7 +38,7 @@ while($csv = fgetcsv($input, 0, ";")) {
$ext_cam_id = $db->escape($csv[1]);
$ucode = "";
$res = $db->select("Preorder", "*", "addon_data LIKE '%$ext_order_id%' AND (deleted = 0 OR deleted IS NULL)");
$res = $db->select("Preorder", "*", "addon_data LIKE '%$ext_order_id%'");
if(!$db->num_rows($res)) {
file_put_contents("php://stderr", "!!! No order found for $ext_order_id\n");
} elseif($db->num_rows($res) > 1) {
@@ -47,7 +47,11 @@ while($csv = fgetcsv($input, 0, ";")) {
$order = $db->fetch_object($res);
$ucode = $order->ucode;
}
$status = "";
if($order->deleted) {
$status = "canceled";
}
echo "$ext_order_id;$ext_cam_id;$ucode\n";
echo "$ext_order_id;$ext_cam_id;$ucode;$status\n";
}