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:
copilot-swe-agent[bot] 2026-05-02 12:23:23 +00:00 committed by GitHub
parent 4a1b5bc725
commit 3066d9c75c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 20 deletions

View file

@ -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;