完善订单交接结账流程留痕

This commit is contained in:
yml2213
2026-08-28 23:48:32 +08:00
parent a9a9127076
commit c87883cc65
27 changed files with 915 additions and 5 deletions
@@ -107,6 +107,8 @@ func (row orderRow) toAdminDTO() OrderDTO {
GrowthPointsAwarded: row.GrowthPointsAwarded,
GrowthPointsAwardedAt: row.GrowthPointsAwardedAt,
AccountSnapshot: row.AccountSnapshot,
AccountSource: effectiveAccountSource(row.RentalOrder),
SourceChannel: row.SourceChannel,
Status: row.Status,
HandoffStatus: row.HandoffStatus,
HandoffMode: effectiveHandoffMode(row.RentalOrder),
@@ -131,6 +133,13 @@ func (row orderRow) toAdminDTO() OrderDTO {
}
}
func effectiveAccountSource(order model.RentalOrder) string {
if order.AccountSource != "" {
return order.AccountSource
}
return "internal"
}
func (row orderRow) toDTOForUser(userID uint64) OrderDTO {
dto := row.toAdminDTO()
dto.AdminActions = nil
@@ -146,6 +155,9 @@ func (row orderRow) toDTOForUser(userID uint64) OrderDTO {
dto.OfflineSettlementRemark = ""
dto.OfflineSettledBy = nil
dto.OfflineSettledAt = nil
// 外部来源渠道属于后台经营信息,仅在管理员订单详情展示。
dto.AccountSource = ""
dto.SourceChannel = ""
applyOrderPriceView(&dto, row.RentalOrder, userID)
return dto
}