Added cancel_date filter in Contract/Index

This commit is contained in:
Frank Schubert
2024-08-01 21:26:03 +02:00
parent 3bec7832f5
commit ef3af99ae4
4 changed files with 26 additions and 3 deletions
@@ -71,6 +71,12 @@ class ContractController extends mfBaseController
$new_filter['add-where'] = " AND (cancel_date IS NULL OR cancel_date > UNIX_TIMESTAMP())";
}
if(array_key_exists("cancel_date", $filter)) {
if($filter["cancel_date"]) {
$new_filter["cancel_date"] = true;
}
}
if (array_key_exists("show_credit", $filter)) {
if ($filter["show_credit"] == 0) {
$new_filter["price>="] = 0;
+10
View File
@@ -597,6 +597,16 @@ class ContractModel {
}
}
if(array_key_exists("cancel_date", $filter)) {
$cancel_date = $filter['cancel_date'];
if($cancel_date == true) {
$where .= " AND Contract.cancel_date > 0";
} elseif($cancel_date === false || $cancel_date === null) {
$where .= " AND (Contract.cancel_date = 0 OR Contract.cancel_date IS NULL)";
}
}
if(array_key_exists("cancel_date>", $filter)) {
$cancel_date = $filter['cancel_date>'];
if(is_numeric($cancel_date)) {