fix(invitation): 线下提号接入邀请返利并补发历史漏发,返利比例文案改读配置
- 线下提号(admin_pickups)不走订单结账流程,此前完全不发邀请返利;现于 Complete() 内按号主利润对半基数发放卖家侧返利 - 迁移 000086:invitation_rebate_ledgers 增加 source 列,唯一键调整为 (source, order_id, trade_role),支持提号来源且保持幂等 - 新增 cmd/rebate-backfill 幂等补发脚本:默认预演,加 -apply 才写库 - 返利阶段文案不再写死 60%/30%/15%,改为按本次实际生效比例生成(钱包流水备注同步修正) - 前台邀请页阶段标签/横幅/空态文案、移动端个人中心入口文案均改读接口配置,并修掉合法 0% 比例被 || 覆盖成 60% 的问题 - 新增单测:提号返利发放与幂等、cycleLabel 跟随后台配置
This commit is contained in:
@@ -23,6 +23,8 @@ export interface AdminRebateRow {
|
||||
id: number
|
||||
order_id: number
|
||||
order_no: string
|
||||
/** 来源单据类型:rental_order=租赁订单,pickup=线下提号 */
|
||||
source?: string
|
||||
distribution_site_id: number
|
||||
inviter_id: number
|
||||
inviter_phone: string
|
||||
|
||||
@@ -367,6 +367,13 @@ function cycleStageLabel(stage: string) {
|
||||
return labels[stage] || stage || '-'
|
||||
}
|
||||
|
||||
/** 返利来源单据类型文案(提号单不走正常订单流程,需要单独标识)。 */
|
||||
function rebateSourceLabel(source?: string) {
|
||||
if (source === 'pickup') return '提号'
|
||||
if (source === 'rental_order') return '订单'
|
||||
return source || '订单'
|
||||
}
|
||||
|
||||
function paymentStatusLabel(status: string) {
|
||||
const labels: Record<string, string> = {
|
||||
created: '已创建',
|
||||
@@ -652,7 +659,18 @@ function goPayments() {
|
||||
<el-table-column label="入账时间" width="160">
|
||||
<template #default="{ row }">{{ formatDateTime(row.settled_at) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="order_no" label="关联订单" width="180" show-overflow-tooltip />
|
||||
<el-table-column label="来源" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
size="small"
|
||||
effect="plain"
|
||||
:type="row.source === 'pickup' ? 'warning' : 'info'"
|
||||
>
|
||||
{{ rebateSourceLabel(row.source) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="order_no" label="关联单据" width="180" show-overflow-tooltip />
|
||||
<el-table-column label="交易人(被邀请人)" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<code class="cell-sub">{{ row.invitee_phone || '-' }}</code>
|
||||
|
||||
@@ -401,7 +401,18 @@ function cycleLabel(cycle: string) {
|
||||
style="width: 100%; margin-top: 16px"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="70" />
|
||||
<el-table-column prop="order_no" label="关联订单号" min-width="160">
|
||||
<el-table-column label="来源" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
size="small"
|
||||
effect="plain"
|
||||
:type="row.source === 'pickup' ? 'warning' : 'info'"
|
||||
>
|
||||
{{ row.source === 'pickup' ? '提号' : '订单' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="order_no" label="关联单据号" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<code>{{ row.order_no }}</code>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user