updated vodia identity
This commit is contained in:
@@ -414,12 +414,18 @@ class AddressModel {
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists("pfm", $filter)) {
|
||||
$pfm = FronkDB::singleton()->escape($filter["pfm"]);
|
||||
if ($pfm) {
|
||||
$where .= " AND (phone like '%$pfm%' OR fax like '%$pfm%' OR mobile like '%$pfm%' )";
|
||||
$pfm = preg_replace('/^(43|0)/', '', preg_replace('/[^0-9]/', '', $filter['pfm'] ?? ''));
|
||||
if (!empty($pfm)) {
|
||||
$pfmEscaped = FronkDB::singleton()->escape($pfm);
|
||||
$searchColumns = ['phone', 'fax', 'mobile'];
|
||||
|
||||
$conditions = array_map(function ($column) use ($pfmEscaped) {
|
||||
$normalizedColumn = "REGEXP_REPLACE(REGEXP_REPLACE(`$column`, '[^0-9]', ''), '^(43|0)', '')";
|
||||
return "$normalizedColumn LIKE '%$pfmEscaped%'";
|
||||
}, $searchColumns);
|
||||
|
||||
$where .= " AND (" . implode(' OR ', $conditions) . ")";
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists("billing_type", $filter)) {
|
||||
$billing_type = FronkDB::singleton()->escape($filter["billing_type"]);
|
||||
|
||||
Reference in New Issue
Block a user