This commit is contained in:
nanguaboss
2026-08-06 00:50:23 +08:00
parent 595520822a
commit 2cb688ed46
29 changed files with 5227 additions and 186 deletions
+3 -3
View File
@@ -36,14 +36,14 @@ if (isset($_POST['contacts'])) {
$contacts = json_decode($_POST['contacts'], true);
if (is_array($contacts)) {
$ins = $pdo->prepare(
"INSERT INTO social_accounts (owner_type, owner_id, platform, account_id, profile_url, remark, is_primary)
VALUES ('person', ?, ?, ?, ?, ?, ?)"
"INSERT INTO social_accounts (owner_type, owner_id, platform, account_id, profile_url, remark, is_primary, is_defult)
VALUES ('person', ?, ?, ?, ?, ?, ?, ?)"
);
foreach ($contacts as $c) {
$platform = trim($c['platform'] ?? '');
$accountId = trim($c['account_id'] ?? '');
if ($platform === '' || $accountId === '') continue;
$ins->execute([$id, $platform, $accountId, $c['profile_url'] ?? null, $c['remark'] ?? null, !empty($c['is_primary']) ? 1 : 0]);
$ins->execute([$id, $platform, $accountId, $c['profile_url'] ?? null, $c['remark'] ?? null, !empty($c['is_primary']) ? 1 : 0, !empty($c['is_defult']) ? 1 : 0]);
}
}
}