完善订单交接结账流程留痕
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user