Added Preorder attributes and checkboxes in list

This commit is contained in:
Frank Schubert
2023-03-08 14:49:47 +01:00
parent 835d9b1b58
commit 9d02064aa2
5 changed files with 142 additions and 5 deletions
+17
View File
@@ -51,6 +51,7 @@ class PreorderModel {
public $shipping_address;
public $addon_services;
public $addon_data;
public $attributes;
public $submit_type;
public $submit_request;
@@ -442,6 +443,22 @@ class PreorderModel {
}
}
if(array_key_exists("attributes", $filter)) {
$attributes = FronkDB::singleton()->escape($filter['attributes']);
if(is_array($attributes) && count($attributes)) {
if(array_key_exists("bep_specified", $attributes)) {
if($attributes['bep_specified']) {
$where .= " AND JSON_EXTRACT(attributes, \"$.bep_specified\") = 1";
}
}
if(array_key_exists("inhouse_cabling_supplied", $attributes)) {
if($attributes['inhouse_cabling_supplied']) {
$where .= " AND JSON_EXTRACT(attributes, \"$.inhouse_cabling_supplied\") = 1";
}
}
}
}
// custom where clause
if(array_key_exists("add-where", $filter)) {
$where .= " ".$filter['add-where'];