add pay
This commit is contained in:
@@ -16,6 +16,7 @@ const (
|
||||
BillTypePayByAccountBalance = 25 //余额支付
|
||||
BillTypePayByMixPay1 = 26 //混合支付中的 余额部分状态码
|
||||
BillTypePayByMixPay2 = 27 //混合支付中的 微信部分状态码
|
||||
BillMixPayRefund1 = 28 //混合支付 余额部分退款
|
||||
BillTypeQuitGroup = 30 //退群
|
||||
|
||||
BillTypeJdWaybillOverWeight = 40 //京东物流超重扣款
|
||||
@@ -51,7 +52,7 @@ type MixPay struct {
|
||||
BalancePrice int `orm:"column(balance_price)" json:"balance_price"` //余额支付部分
|
||||
TotalPrice int `orm:"column(total_price)" json:"total_price"` //订单总额
|
||||
WxPrice int `orm:"column(wx_price)" json:"wx_price"` //微信支付部分
|
||||
Method int `orm:"column(method)" json:"method"` //支付方式 1-余额支付,2-微信支付,5-余额+微信混合支付
|
||||
Status int `orm:"column(status)" json:"status"` //订单状态 退款/正常
|
||||
}
|
||||
|
||||
func (v *MixPay) TableIndex() [][]string {
|
||||
|
||||
@@ -135,3 +135,27 @@ func UpdateUserBill(userId string, money int) error {
|
||||
_, err := ExecuteSQL(GetDB(), `UPDATE user_bill SET account_balance = ? WHERE user_id = ? `, []interface{}{money, userId}...)
|
||||
return err
|
||||
}
|
||||
|
||||
type MixPayDetail struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
LastOperator string `json:"lastOperator"`
|
||||
OrderID string `json:"order_id"`
|
||||
BalancePrice int `json:"balance_price"`
|
||||
TotalPrice int `json:"total_price"`
|
||||
WxPrice int `json:"wx_price"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
//获取混合支付 余额部分信息
|
||||
func GetMixPayDetail(orderID string) (mixPayDetail []*MixPayDetail, err error) {
|
||||
sql := `SELECT * FROM mix_pay WHERE deleted_at = ? `
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if orderID != "" {
|
||||
sql += "AND order_id = ?"
|
||||
sqlParams = append(sqlParams, orderID)
|
||||
}
|
||||
err = GetRow(GetDB(), &mixPayDetail, sql, sqlParams)
|
||||
return mixPayDetail, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user