OnlyShow filter fix
This commit is contained in:
@@ -14,6 +14,7 @@ $searchForEnabled = isset($post['searchForEnabled']) ? (string)$post['searchForE
|
|||||||
$searchForValue = (string)$post['searchForValue'] ?? '';
|
$searchForValue = (string)$post['searchForValue'] ?? '';
|
||||||
$onlyShowEnabled = isset($post['onlyShowEnabled']) ? (string)$post['onlyShowEnabled'] == 'False' ? false : true : false;
|
$onlyShowEnabled = isset($post['onlyShowEnabled']) ? (string)$post['onlyShowEnabled'] == 'False' ? false : true : false;
|
||||||
$onlyShowValue = (string)$post['onlyShowValue'] ?? '';
|
$onlyShowValue = (string)$post['onlyShowValue'] ?? '';
|
||||||
|
$currentIcons = json_decode(base64_decode((string)($post['currentIcons'] ?? 'W10K')));
|
||||||
|
|
||||||
$where = ["u.banned = 0", "(c.state = 1 OR c.state = 2)"];
|
$where = ["u.banned = 0", "(c.state = 1 OR c.state = 2)"];
|
||||||
$params = [];
|
$params = [];
|
||||||
@@ -47,6 +48,16 @@ if ($onlyShowEnabled) {
|
|||||||
$where[] = "c.userId != ?";
|
$where[] = "c.userId != ?";
|
||||||
$params[] = $userId;
|
$params[] = $userId;
|
||||||
$types .= "i";
|
$types .= "i";
|
||||||
|
} elseif ($onlyShowValue === '2') {
|
||||||
|
$placeholders = implode(',', array_fill(0, count($currentIcons), '?'));
|
||||||
|
$where[] = "c.uuid IN ($placeholders)";
|
||||||
|
$params = array_merge($params, $currentIcons);
|
||||||
|
$types .= str_repeat('s', count($currentIcons));
|
||||||
|
} elseif ($onlyShowValue === '3') {
|
||||||
|
$placeholders = implode(',', array_fill(0, count($currentIcons), '?'));
|
||||||
|
$where[] = "c.uuid NOT IN ($placeholders)";
|
||||||
|
$params = array_merge($params, $currentIcons);
|
||||||
|
$types .= str_repeat('s', count($currentIcons));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user