v1.0.50: 碎片处理6项修改 - 1)硬数据板块改名为「硬数据碎片新增与处理」;2)硬数据彻底移除「状态」字段(查看弹窗/数据表status列/列表接口全部删除,已转换以converted_id非空标识,preliminary旧页同步清理);3)硬数据操作列「继续补全」改「手动补全」+新增「AI补全」占位;4)软数据操作列「补全」改「手动补全」+新增「AI补全」占位;5)硬数据「废弃」改为从preliminary_data彻底硬删除;6)人员性别枚举收敛为男/女/未知(迁移归并其他/保密)

This commit is contained in:
nanguaboss
2026-08-11 00:09:33 +08:00
parent 9f06ee1cd9
commit 69fd4246c2
15 changed files with 92 additions and 85 deletions
+2 -4
View File
@@ -1,7 +1,7 @@
<?php
/**
* 碎片处理列表接口(待定逻辑,暂做基础列表) GET/POST /api/preliminary/list.php
* 参数:page / limit / keyword / status / source_type / start_date / end_date
* 参数:page / limit / keyword / source_type / start_date / end_date
*/
require_once __DIR__ . '/../common/db.php';
require_once __DIR__ . '/../common/response.php';
@@ -11,7 +11,6 @@ checkPermission('preliminary');
[$page, $limit] = pageParams();
$keyword = trim($_REQUEST['keyword'] ?? '');
$status = trim($_REQUEST['status'] ?? '');
$sourceType = trim($_REQUEST['source_type'] ?? '');
$startDate = trim($_REQUEST['start_date'] ?? '');
$endDate = trim($_REQUEST['end_date'] ?? '');
@@ -23,7 +22,6 @@ if ($keyword !== '') {
$like = "%$keyword%";
array_push($params, $like, $like, $like, $like, $like);
}
if ($status !== '') { $where[] = 'status = ?'; $params[] = $status; }
if ($sourceType !== '') { $where[] = 'source_type = ?'; $params[] = $sourceType; }
if ($startDate !== '') { $where[] = 'DATE(created_at) >= ?'; $params[] = $startDate; }
if ($endDate !== '') { $where[] = 'DATE(created_at) <= ?'; $params[] = $endDate; }
@@ -38,7 +36,7 @@ $total = (int)$stmt->fetchColumn();
$offset = ($page - 1) * $limit;
$stmt = $pdo->prepare(
"SELECT id, source_type, company_name, person_name, contact_phone, contact_email,
target_product_category, description, status, source_channel, recorded_by,
source_channel, recorded_by,
follow_person, converted_type, converted_id, created_at, updated_at
FROM preliminary_data
WHERE $whereSql
+1 -11
View File
@@ -1,7 +1,7 @@
<?php
/**
* 碎片处理统计接口 GET /api/preliminary/stats.php
* 返回:总数 / 今日新增 / 各状态数量
* 返回:总数 / 今日新增
*/
require_once __DIR__ . '/../common/db.php';
require_once __DIR__ . '/../common/response.php';
@@ -14,17 +14,7 @@ $pdo = DB::getInstance()->getPdo();
$total = (int)$pdo->query("SELECT COUNT(*) FROM preliminary_data WHERE is_active = 1")->fetchColumn();
$today = (int)$pdo->query("SELECT COUNT(*) FROM preliminary_data WHERE is_active = 1 AND DATE(created_at) = CURDATE()")->fetchColumn();
$statusRows = $pdo->query(
"SELECT status, COUNT(*) AS cnt FROM preliminary_data WHERE is_active = 1 GROUP BY status"
)->fetchAll();
$statusMap = [];
foreach ($statusRows as $r) {
$statusMap[$r['status']] = (int)$r['cnt'];
}
Response::success([
'total' => $total,
'today' => $today,
'status' => $statusMap,
'statuses' => ['待处理', '待分配', '处理中', '已转换', '已废弃', '已拒收'],
]);