Update ConstructionConsent.php

This commit is contained in:
Luca Haid
2025-03-12 14:24:04 +00:00
parent 70531717d6
commit c7185d986b

View File

@@ -409,6 +409,7 @@ class ConstructionConsent extends mfBaseModel {
GROUP BY ConstructionConsent.id
$having
ORDER BY $order";
// die($sql);
if(is_array($limit) && count($limit)) {
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
@@ -580,10 +581,15 @@ class ConstructionConsent extends mfBaseModel {
}
}
if (array_key_exists("cwo", $filter)) {
$where .= " AND EXISTS
(SELECT 1 FROM ConstructionConsentOwner co WHERE co.constructionconsent_id = ConstructionConsent.id AND
LOWER(CONCAT(co.FIRST_NAME, ' ', co.LAST_NAME)) LIKE LOWER('%".$filter['cwo']."%')";
if (array_key_exists("cwo", $filter) && !empty($filter['cwo'])) {
$where .= "
AND EXISTS (
SELECT 1
FROM ConstructionConsentOwner co
WHERE co.constructionconsent_id = ConstructionConsent.id
AND LOWER(CONCAT(co.firstname, ' ', co.lastname)) LIKE LOWER('%".$filter['cwo']."%')
)
";
}