Added cancel_date filter in Contract/Index
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user