78 lines
3.3 KiB
Go
78 lines
3.3 KiB
Go
package model
|
||
|
||
import "time"
|
||
|
||
const (
|
||
WithdrawalWaitRecord = 1 // 审核中
|
||
WithdrawalRecordFail = 2 // 审核失败
|
||
WithdrawalRecordPayFail = 3 // 支付失败
|
||
WithdrawalRecordPaySuccess = 4 // 支付成功
|
||
)
|
||
|
||
// WithdrawalRecord 提现审核
|
||
type WithdrawalRecord struct {
|
||
ModelIDCULD
|
||
OrderID string `orm:"column(order_id)" json:"orderID"` // 订单号
|
||
UserID string `orm:"column(user_id);size(48)" json:"userID"` // 用户ID
|
||
WithdrawalMoney int `orm:"column(withdrawal_money);size(16)" json:"withdrawalMoney"` // 提现金额
|
||
ServiceCharge int `orm:"column(service_charge);size(16)" json:"serviceCharge"` // 手续费
|
||
PayMoney int `orm:"column(pay_money);size(16)" json:"payMoney"` // 实际提现金额
|
||
AlipayAccount string `orm:"column(alipay_account);size(64)" json:"alipayAccount"` // 支付宝账号
|
||
AlipayName string `orm:"column(alipay_name);size(64)" json:"alipayName"` // 支付宝姓名
|
||
AlipayOrderId string `orm:"column(alipay_order_id);size(64)" json:"alipayOrderId"` // 支付宝订单号
|
||
OrderStatus int `orm:"column(order_status);size(8)" json:"OrderStatus"` // 订单状态1-审核中,2-审核失败,3-支付失败,4-支付成功,5-取消
|
||
PayTime time.Time `orm:"type(datetime);null" json:"payTime"` // 提现支付时间
|
||
Remark string `orm:"column(remark);type(text)" json:"remark"` // 备注信息
|
||
Lng float64 `orm:"digits(10);decimals(6)" json:"lng"` // 坐标
|
||
Lat float64 `orm:"digits(10);decimals(6)" json:"lat"` // 坐标
|
||
CityCode int `orm:"default(0)" json:"cityCode"` // 提交订单时用户所在城市
|
||
DistrictCode int `orm:"default(0)" json:"districtCode"` // 城市code
|
||
}
|
||
|
||
// AddWithdrawalRecordReq 用户发起提现申请
|
||
type AddWithdrawalRecordReq struct {
|
||
WithdrawalMoney int `json:"withdrawalMoney"`
|
||
AlipayAccount string `json:"alipayAccount"`
|
||
AlipayName string `json:"alipayName"`
|
||
Lng float64 `json:"lng"` // 坐标
|
||
Lat float64 `json:"lat"` // 坐标
|
||
CityCode int `json:"cityCode"` // 提交订单时用户所在城市
|
||
DistrictCode int `json:"districtCode"` // 城市code
|
||
}
|
||
|
||
func (*WithdrawalRecord) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"OrderID"},
|
||
[]string{"AlipayOrderId"},
|
||
}
|
||
}
|
||
|
||
func (*WithdrawalRecord) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"UserID", "OrderID"},
|
||
[]string{"CreatedAt"},
|
||
[]string{"OrderID"},
|
||
}
|
||
}
|
||
|
||
// 结构体
|
||
|
||
type OrderListParam struct {
|
||
PageSize int `json:"pageSize"`
|
||
PageNum int `json:"pageNum"`
|
||
UserId string `json:"userId"`
|
||
UserName string `json:"userName"`
|
||
OrderId string `json:"orderId"`
|
||
Phone string `json:"phone"`
|
||
OrderStatus int `json:"orderStatus"`
|
||
StartTime string `json:"startTime"`
|
||
EndTime string `json:"endTime"`
|
||
}
|
||
|
||
type WithdrawalListRes struct {
|
||
WithdrawalRecord
|
||
Name string `json:"name"`
|
||
Mobile string `json:"mobile"`
|
||
AccountBalance int `json:"accountBalance"`
|
||
}
|