v1.0.12: 企业/人员/媒体去删除入口;企业/人员加产品入口;企业详情去产品品类/关联联系人;编辑企业改Tab卡(工商信息/财务信息/资质认证)

This commit is contained in:
nanguaboss
2026-08-03 23:22:33 +08:00
parent 71c6e8d9c1
commit 96cba121a8
14 changed files with 644 additions and 83 deletions
+12 -4
View File
@@ -25,12 +25,20 @@ if ((int)$chk->fetchColumn() === 0) {
Response::error('人员不存在');
}
$where = ['pwe.person_id = ?', 'pwe.is_active = 1'];
$params = [$personId];
if (isset($_REQUEST['is_current']) && $_REQUEST['is_current'] !== '') {
$where[] = 'pwe.is_current = ?';
$params[] = (int)$_REQUEST['is_current'] ? 1 : 0;
}
$whereSql = implode(' AND ', $where);
$stmt = $pdo->prepare(
"SELECT COUNT(*) FROM person_work_experiences pwe
INNER JOIN companies c ON c.id = pwe.company_id
WHERE pwe.person_id = ? AND pwe.is_active = 1"
WHERE $whereSql"
);
$stmt->execute([$personId]);
$stmt->execute($params);
$total = (int)$stmt->fetchColumn();
$offset = ($page - 1) * $limit;
@@ -42,11 +50,11 @@ $stmt = $pdo->prepare(
pwe.start_date, pwe.end_date, pwe.is_current
FROM person_work_experiences pwe
INNER JOIN companies c ON c.id = pwe.company_id
WHERE pwe.person_id = ? AND pwe.is_active = 1
WHERE $whereSql
ORDER BY pwe.is_current DESC, pwe.start_date DESC
LIMIT $limit OFFSET $offset"
);
$stmt->execute([$personId]);
$stmt->execute($params);
$list = $stmt->fetchAll();
Response::success(['list' => $list, 'total' => $total, 'page' => $page, 'limit' => $limit]);