Updated Warehouse

This commit is contained in:
Luca Haid
2025-02-04 19:06:08 +01:00
parent 514d5d5d7e
commit 7c8af7aed4
24 changed files with 1126 additions and 99 deletions

View File

@@ -8,7 +8,7 @@ class Helper {
* @param string $columnName The name of the column in the database table.
* @return string The SQL condition generated based on the filter value and column name.
*/
public static function generateFilterCondition($filterValue, string $columnName, bool $exactMatch = false): string {
public static function generateFilterCondition($filterValue, $columnName, bool $exactMatch = false): string {
$sql = "";
if (is_array($filterValue)) {
@@ -30,6 +30,9 @@ class Helper {
} else if (!empty($filterValue)) {
if ($exactMatch) {
$sql .= " AND `$columnName` = '" . $filterValue . "'";
} else if (strpos($columnName, "|") !== false) {
foreach (explode(" ", $filterValue) as $item)
$sql .= " AND CONCAT(" . join(",", explode("|", $columnName)) . ") LIKE '%" . str_replace("%", "", $item) . "%'";
} else if ($filterValue[0] === "%") {
$sql .= " AND `$columnName` LIKE '" . $filterValue . "'";
} else if ($filterValue[strlen($filterValue) - 1] === "%") {