v1.0.47: 新增弹窗按类型动态字段(企业:名称/行业/注册号/联系人/电话邮箱/身份证/社媒;人员:姓名/电话邮箱/身份证/社媒;产品:名称/品类;需求:名称/需求类别)+各类型转软碎片要求(企业需名称+行业+注册号,人员需姓名+联系方式,产品需品类,需求需类别,前后端双校验)+preliminary_data加行业/注册号列
This commit is contained in:
@@ -29,6 +29,10 @@ $idNumber = trim($_POST['id_number'] ?? '');
|
||||
$platform = trim($_POST['platform'] ?? '');
|
||||
$accountId = trim($_POST['account_id'] ?? '');
|
||||
$profileUrl = trim($_POST['profile_url'] ?? '');
|
||||
$industry = trim($_POST['industry'] ?? ''); // 企业:行业
|
||||
$registrationNum = trim($_POST['registration_number'] ?? ''); // 企业:注册号
|
||||
$category = trim($_POST['target_product_category'] ?? ''); // 产品:品类(存 extra)
|
||||
$needCategory = trim($_POST['need_category'] ?? ''); // 需求:需求类别(存 extra)
|
||||
$sourceChannel = trim($_POST['source_channel'] ?? '');
|
||||
|
||||
// 硬数据标准校验:
|
||||
@@ -70,12 +74,14 @@ if ($accountId !== '' && $platform !== '') {
|
||||
}
|
||||
if (!empty($dups)) Response::duplicates($dups);
|
||||
|
||||
// 额外信息(身份证/社媒平台/账号ID/主页链接)存 extra_info
|
||||
// 额外信息(身份证/社媒平台/账号ID/主页链接/产品品类/需求类别)存 extra_info
|
||||
$extra = [];
|
||||
if ($idNumber !== '') $extra['id_number'] = $idNumber;
|
||||
if ($platform !== '') $extra['platform'] = $platform;
|
||||
if ($accountId !== '') $extra['account_id'] = $accountId;
|
||||
if ($profileUrl !== '') $extra['profile_url'] = $profileUrl;
|
||||
if ($category !== '') $extra['category'] = $category;
|
||||
if ($needCategory !== '') $extra['need_category'] = $needCategory;
|
||||
|
||||
// 至少有一项内容才能录为碎片
|
||||
if ($companyName === '' && $personName === '' && $phone === '' && $email === '' && !$extra) {
|
||||
@@ -84,12 +90,14 @@ if ($companyName === '' && $personName === '' && $phone === '' && $email === ''
|
||||
|
||||
$pdo->prepare(
|
||||
"INSERT INTO preliminary_data
|
||||
(source_type, company_name, person_name, contact_phone, contact_email,
|
||||
(source_type, company_name, industry, registration_number, person_name, contact_phone, contact_email,
|
||||
source_channel, recorded_by, status, extra_info)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, '待处理', ?)"
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, '待处理', ?)"
|
||||
)->execute([
|
||||
$sourceType,
|
||||
$companyName !== '' ? $companyName : null,
|
||||
$industry !== '' ? $industry : null,
|
||||
$registrationNum !== '' ? $registrationNum : null,
|
||||
$personName !== '' ? $personName : null,
|
||||
$phone !== '' ? $phone : null,
|
||||
$email !== '' ? $email : null,
|
||||
|
||||
Reference in New Issue
Block a user