+ $new_values = [];
+ $condition_string = "";
+ foreach ($condition as $field => $value) {
+ if ($condition_string != "") {
+ $condition_string .= " AND ";
+ }
+ if (is_array($value)) {
+ $new_values = array_merge($new_values, array_values($value));
+ $placeholders = substr(str_repeat("?, ", count($value)), 0, -2);
+ $condition_string .= "`" . $field . "` IN (" . $placeholders . ")";
+ } else {
+ $new_values[$field] = $value;
+ $condition_string .= "`" . $field . "` = ?";
+ }
+ }
+ $condition_string = " WHERE " . $condition_string;
+ $condition = $new_values;