Files
jx-callback/business/model/order.go
苏尹岚 2ae5f3a793 shan
2020-10-23 15:21:58 +08:00

84 lines
2.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import "time"
const (
OrderDeliveryTypePlatform = "platform" // 平台负责配送
OrderDeliveryTypeStoreSelf = "store" // 门店自送
OrderDeliveryTypeSelfTake = "self" // 用户自提
)
const (
PayTypeWX = 1 // 微信支付
PayTypeTL = 2 // 通联宝支付
PayStatusNo = 0
PayStatusYes = 1
PayStatusFailed = 2
PayStatusCanceled = 3
PayStatusRefund = 4
RefundStatusNo = 0
RefundStatusYes = 1
RefundStatusFailed = 2
EarningTypeQuote = 1 //报价模式
EarningTypePoints = 2 //扣点模式
VendorPayTypeCompanyPay = "companyPay" //企业付款
)
const (
OrderTypeAddressErr = -1 //地址异常订单
OrderTypeNormal = 0 //普通订单
OrderTypeMatter = 1 //物料订单
OrderTypeSupplyGoods = 2 //进货订单
OrderTypeDefendPrice = 3 //守价订单
OrderTypeAccount = 1 //账户余额
)
var (
PayStatusName = map[int]string{
PayStatusNo: "待支付",
PayStatusYes: "已支付",
PayStatusFailed: "支付失败",
PayStatusCanceled: "支付取消",
PayStatusRefund: "已退款",
}
RefundStatusName = map[int]string{
RefundStatusNo: "待退款",
RefundStatusYes: "已退款",
RefundStatusFailed: "退款失败",
}
)
type Order struct {
ModelIDCUL
OrderID int64 `orm:"column(order_id)" json:"orderID"` //订单号
UserID string `orm:"column(user_id);size(48)" json:"userID"` //用户ID
Type int `json:"type"` //订单类型
Status int `json:"status"` //订单状态,待支付2已支付5支付成功110支付失败115
PayPrice int `json:"payPrice"` //支付金额
TransactionID string `orm:"column(transaction_id);size(48)" json:"transactionID"` // 支付成功后支付方生成的事务ID
PayFinishedAt time.Time `orm:"type(datetime);null" json:"payFinishedAt"`
PrepayID string `orm:"column(prepay_id);size(48)" json:"prepayID"` // 下单后支付前支付方生成的事务ID
OriginalData string `orm:"type(text)" json:"-"`
Comment string `orm:"size(255)" json:"comment"` //备注
}
func (v *Order) TableUnique() [][]string {
return [][]string{
[]string{"OrderID"},
}
}
func (v *Order) TableIndex() [][]string {
return [][]string{
[]string{"CreatedAt"},
[]string{"UserID"},
}
}