Added Preorderselfservice API

This commit is contained in:
Frank Schubert
2024-12-11 15:45:46 +01:00
parent 2154b326c2
commit 2c4a84b95d
3 changed files with 112 additions and 1 deletions
+19
View File
@@ -670,6 +670,25 @@ class PreorderModel {
$where .= " AND tt_preorder.extref = '$extref'";
}
}
if(array_key_exists("email", $filter)) {
$email = FronkDB::singleton()->escape($filter['email']);
if($email) {
$where .= " AND tt_preorder.email = '$email'";
}
}
if(array_key_exists("phone", $filter)) {
$phone = $filter["phone"];
if(is_array($phone)) {
$where .= " AND REGEXP_REPLACE(tt_preorder.phone, '[^0-9]+', '') IN ('".implode("','", $phone)."')";
} else {
$phone = FronkDB::singleton()->escape($filter['phone']);
if($phone) {
$where .= " AND REGEXP_REPLACE(tt_preorder.phone, '[^0-9]+', '') = '$phone'";
}
}
}
if(array_key_exists("workorder_export_date", $filter)) {
$workorder_export_date = $filter['workorder_export_date'];