v1.0.41: 硬数据流程调整 - 区块标题去【】+preliminary_data瘦身(删非必要字段品类/描述,备份表已建)+硬数据标准(人员需手机/邮箱至少一,企业需名称必填,前后端校验)+完整度字段改4项

This commit is contained in:
nanguaboss
2026-08-10 00:10:53 +08:00
parent df8439fcb5
commit 7fc0546a1e
7 changed files with 41 additions and 26 deletions
+4 -4
View File
@@ -39,8 +39,8 @@ $companyName = trim($_POST['company_name'] ?? ($frag['company_name'] ?? ''));
$personName = trim($_POST['person_name'] ?? ($frag['person_name'] ?? ''));
$phone = trim($_POST['contact_phone'] ?? ($frag['contact_phone'] ?? ''));
$email = trim($_POST['contact_email'] ?? ($frag['contact_email'] ?? ''));
$category = trim($_POST['target_product_category'] ?? ($frag['target_product_category'] ?? ''));
$description = trim($_POST['description'] ?? ($frag['description'] ?? ''));
$category = trim($_POST['target_product_category'] ?? ''); // 仅补全录入表单提供(表中已无该字段)
$description = trim($_POST['description'] ?? ''); // 仅补全录入表单提供
$industry = trim($_POST['industry'] ?? '');
$sourceChannel = $frag['source_channel'] ?? null;
@@ -105,7 +105,7 @@ switch ($targetType) {
$industry !== '' ? $industry : null,
$description !== '' ? $description : null,
$sourceChannel,
$frag['description'] ?? null,
$description !== '' ? $description : null,
]);
$convertedId = (int)$pdo->lastInsertId();
$saveContacts('company', $convertedId);
@@ -120,7 +120,7 @@ switch ($targetType) {
$unionId = 'P' . date('YmdHis') . substr(uniqid(), -6);
$pdo->prepare(
"INSERT INTO persons (union_id, full_name, source_channel, source_detail) VALUES (?, ?, ?, ?)"
)->execute([$unionId, $personName, $sourceChannel, $frag['description'] ?? null]);
)->execute([$unionId, $personName, $sourceChannel, $description !== '' ? $description : null]);
$convertedId = (int)$pdo->lastInsertId();
$saveContacts('person', $convertedId);
updateIncomplete($pdo, 'persons', $convertedId);