feat(promo): HQ 推广码订单只计已完成并补扫码订单快链

列表与详情的订单数/转化率按 COMPLETED 实时统计;扫码、订单、事件 ID 可跳到对应页。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-28 12:55:19 +08:00
parent 737efb89a3
commit fccfd7abbe
15 changed files with 421 additions and 124 deletions
+10
View File
@@ -18,6 +18,16 @@ export interface AdminOrdersListQuery extends AdminListQuery {
deliveryType?: string;
}
export interface AdminUsersListQuery extends AdminListQuery {
phone?: string;
userNo?: string;
userId?: string;
deviceKey?: string;
phoneVerified?: string;
status?: number;
excludeTest?: boolean;
}
export interface UpdateAdminUserRequest {
hqRemark: string;
}
+5
View File
@@ -35,6 +35,7 @@ export type PromoCodeItem = {
qrcodeId: string;
status: PromoCodeStatus;
scanCount: number;
/** 已完成订单数(status=COMPLETED */
orderCount: number;
landingUrl: string;
qrcodeUrl?: string | null;
@@ -47,6 +48,7 @@ export type PromoCodeItem = {
export type PromoCodeStats = {
/** 扫码进入次数 */
scanCount: number;
/** 已完成订单数(status=COMPLETED */
orderCount: number;
conversionRate: number;
/** 归因用户数(user_promo_attribution */
@@ -66,6 +68,7 @@ export type PromoCodeAttributedUser = {
sourceType: string;
sourceRefId: string | null;
firstTouchAt: string | null;
/** 该用户已完成订单数 */
orderCount: number;
createdAt: string;
};
@@ -98,7 +101,9 @@ export type PromoMetricEventItem = {
id: string;
eventType: PromoMetricEventType;
userId: string | null;
userNo?: string | null;
orderId: string | null;
orderNo?: string | null;
sessionId: string | null;
clientIp: string | null;
ipProvince: string | null;