feat: 完善视频任务与 KOC 资源库
This commit is contained in:
@@ -15,8 +15,12 @@ type AccountRow = {
|
||||
profile_url: string;
|
||||
ip_location: string;
|
||||
followers: number;
|
||||
gender: string;
|
||||
bio: string;
|
||||
tags: string;
|
||||
post_count: number;
|
||||
cooperation_source: string;
|
||||
current_contact: string;
|
||||
first_seen_at: string;
|
||||
last_seen_at: string;
|
||||
};
|
||||
@@ -24,6 +28,7 @@ type AccountRow = {
|
||||
type CooperationRow = {
|
||||
account_id: string;
|
||||
partner_name: string;
|
||||
claimant_name: string | null;
|
||||
delegation_bundle_id: string | null;
|
||||
};
|
||||
|
||||
@@ -74,9 +79,11 @@ async function exportAccounts(accountIds: string[]) {
|
||||
`SELECT
|
||||
d.account_id,
|
||||
p.name AS partner_name,
|
||||
cl.claimant_name,
|
||||
d.delegation_bundle_id
|
||||
FROM distributions d
|
||||
JOIN partners p ON p.id = d.partner_id
|
||||
LEFT JOIN claims cl ON cl.id = d.claim_id
|
||||
WHERE d.account_id IS NOT NULL`,
|
||||
)
|
||||
.all<CooperationRow>(),
|
||||
@@ -109,8 +116,12 @@ async function exportAccounts(accountIds: string[]) {
|
||||
"账号主页",
|
||||
"IP地",
|
||||
"粉丝数",
|
||||
"性别",
|
||||
"简介",
|
||||
"标签",
|
||||
"合作发布数",
|
||||
"历史合作来源",
|
||||
"当前联系人",
|
||||
"资源归属",
|
||||
"首次合作时间",
|
||||
"最近合作时间",
|
||||
@@ -119,7 +130,13 @@ async function exportAccounts(accountIds: string[]) {
|
||||
const cooperation = cooperationByAccount.get(account.id) ?? [];
|
||||
const sources = [
|
||||
...new Set([
|
||||
...cooperation.map((item) => item.partner_name),
|
||||
...cooperation
|
||||
.filter(
|
||||
(item) =>
|
||||
!item.claimant_name ||
|
||||
item.partner_name !== item.claimant_name,
|
||||
)
|
||||
.map((item) => item.partner_name),
|
||||
...(account.cooperation_source || "")
|
||||
.split(/[、,,;;|]/)
|
||||
.map((item) => item.trim())
|
||||
@@ -138,8 +155,12 @@ async function exportAccounts(accountIds: string[]) {
|
||||
account.profile_url || "",
|
||||
account.ip_location || "待识别",
|
||||
account.followers,
|
||||
account.gender || "",
|
||||
account.bio || "",
|
||||
account.tags || "",
|
||||
account.post_count,
|
||||
sources.join("、"),
|
||||
account.current_contact || "",
|
||||
partnerManagedOnly ? "合作社资源 · 不可直联" : "可直联",
|
||||
formatExportDate(account.first_seen_at),
|
||||
formatExportDate(account.last_seen_at),
|
||||
@@ -161,9 +182,13 @@ async function exportAccounts(accountIds: string[]) {
|
||||
44,
|
||||
14,
|
||||
14,
|
||||
10,
|
||||
36,
|
||||
32,
|
||||
14,
|
||||
32,
|
||||
22,
|
||||
22,
|
||||
21,
|
||||
21,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user