fix(billing): address code review issues - ALTER TABLE syntax, null period handling, type detection
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e8da2cb7-dbf1-4296-b25d-766f8e099581 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
4a1b5bc725
commit
3066d9c75c
6 changed files with 39 additions and 20 deletions
|
|
@ -200,7 +200,16 @@ class BillingRepository
|
|||
if (array_key_exists($col, $data)) {
|
||||
$set[] = "`{$col}` = ?";
|
||||
$params[] = $data[$col];
|
||||
$types .= is_int($data[$col]) ? 'i' : 's';
|
||||
$val = $data[$col];
|
||||
if ($val === null) {
|
||||
$types .= 's'; // NULL binds safely as string in mysqli
|
||||
} elseif (is_int($val)) {
|
||||
$types .= 'i';
|
||||
} elseif (is_float($val)) {
|
||||
$types .= 'd';
|
||||
} else {
|
||||
$types .= 's';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($set)) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue