v1.0.33: 全局唯一性校验 - 手机号/邮箱/身份证/企业注册号/社媒账号ID/主页链接/企业名称 新增与修改时校验,重复弹窗提示并跳转定位(后端duplicate_check引擎+code 1001,前端弹窗+person/company/media页?id=跳转)

This commit is contained in:
nanguaboss
2026-08-09 22:27:05 +08:00
parent de1c227727
commit 76593d4dce
15 changed files with 393 additions and 17 deletions
+5
View File
@@ -11,6 +11,7 @@ require_once __DIR__ . '/../common/auth.php';
require_once __DIR__ . '/../common/helpers.php';
require_once __DIR__ . '/../common/logger.php';
require_once __DIR__ . '/../common/completeness.php';
require_once __DIR__ . '/../common/duplicate_check.php';
checkAjax();
checkPermission('company');
@@ -30,6 +31,10 @@ if ((int)$chk->fetchColumn() === 0) {
Response::error('企业不存在');
}
// 唯一性校验:社媒账号ID(同平台)/ 手机 / 邮箱 / 主页链接
$dup = checkSingleAccountDuplicate($pdo, $platform, $accountId, $_POST['profile_url'] ?? '');
if ($dup) Response::duplicate($dup);
$ins = $pdo->prepare(
"INSERT INTO social_accounts (owner_type, owner_id, platform, account_id, profile_url, remark, is_primary, is_defult, is_active)
VALUES ('company', ?, ?, ?, ?, ?, 0, ?, ?)"