|
|
订单列表的
|
|
|
|
|
|
"id": it.ID, // 订单ID
|
|
|
"order_no": it.OrderNo, // 订单号(M=会员订单,R=充值订单)
|
|
|
"user_id": it.UserID, // 用户ID
|
|
|
"user_name": userNameMap[it.UserID], // 用户名
|
|
|
"plan_id": it.PlanID, // 套餐ID(充值订单为0)
|
|
|
"plan_name": planName, // 套餐名称(充值订单固定为“钱包充值”)
|
|
|
"order_type": it.OrderType, // 订单类型:会员购买/钱包充值(中文)
|
|
|
"amount_cents": it.AmountCents.ToInt64(), // 订单金额(分)
|
|
|
"amount": it.AmountCents.String(), // 订单金额(元,字符串,保留两位小数)
|
|
|
"pay_channel": it.PayChannel, // 支付渠道:wallet|wxpay|alipay|other
|
|
|
"status": it.Status, // 订单状态:created|paid|canceled|refunded
|
|
|
"pay_time": it.PayTime, // 支付时间(Unix 时间戳,秒)
|
|
|
"transaction_id": it.TransactionID, // 第三方交易号/平台流水号
|
|
|
"remark": it.Remark, // 备注
|
|
|
"created_at": it.CreatedAt, // 创建时间(Unix 时间戳,秒)
|
|
|
"updated_at": it.UpdatedAt, // 更新时间(Unix 时间戳,秒)
|
|
|
|
|
|
|
|
|
消费列表
|
|
|
|
|
|
"id": it.ID, // 流水ID
|
|
|
"user_id": it.UserID, // 用户ID
|
|
|
"user_name": userName, // 用户名
|
|
|
"type": it.Type, // 交易类型:recharge(充值)|purchase(消费)
|
|
|
"amount_cents": it.AmountCents.ToInt64(), // 金额(分)
|
|
|
"amount": it.AmountCents.String(), // 金额(元,字符串,保留两位小数)
|
|
|
"related_order_id": it.RelatedOrderID, // 关联的订单ID(可为空)
|
|
|
"order_no": it.OrderNo, // 关联订单号(M* 会员订单 / R* 充值订单)
|
|
|
"pay_channel": it.PayChannel, // 支付渠道:wallet|wxpay|alipay|other
|
|
|
"status": it.Status, // 交易状态:success|failed|pending
|
|
|
"remark": it.Remark, // 备注
|
|
|
"balance_before_cents": it.BalanceBeforeCents.ToInt64(), // 变动前余额(分)
|
|
|
"balance_after_cents": it.BalanceAfterCents.ToInt64(), // 变动后余额(分)
|
|
|
"finished_at": it.FinishedAt, // 完成时间(Unix 时间戳,秒)
|
|
|
"external_txn_id": it.ExternalTxnID, // 外部交易号(第三方平台返回)
|
|
|
"currency": it.Currency, // 币种(默认 CNY)
|
|
|
"created_at": it.CreatedAt, // 创建时间(Unix 时间戳,秒)
|
|
|
}) |