From 31cb67499485466d08aaf3b49e5df3362c493d0c Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 3 Aug 2022 14:40:28 +0800 Subject: [PATCH] pay --- business/model/dao/dao_bill.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/business/model/dao/dao_bill.go b/business/model/dao/dao_bill.go index 50078be6e..80ae414bf 100644 --- a/business/model/dao/dao_bill.go +++ b/business/model/dao/dao_bill.go @@ -137,7 +137,9 @@ func UpdateUserBill(userId string, money int) error { } type MixPayDetail struct { + ID int `json:"id"` CreatedAt time.Time `json:"created_at"` + UpdateAt time.Time `json:"update_at"` LastOperator string `json:"lastOperator"` OrderID string `json:"order_id"` BalancePrice int `json:"balance_price"` @@ -147,25 +149,23 @@ type MixPayDetail struct { } //获取混合支付 余额部分信息 -func GetMixPayDetail(orderID string) (details *model.MixPay, err error) { - var info []*model.MixPay +func GetMixPayDetail(orderID string) (details *MixPayDetail, err error) { + var info []*MixPayDetail sqlParams := []interface{}{} sql := "" if orderID != "" { sql += "SELECT order_id,balance_price,total_price,wx_price,status FROM mix_pay WHERE order_id = ?" sqlParams = append(sqlParams, orderID) } - err = GetRow(GetDB(), &info, sql, sqlParams) - if err != nil { - return nil, err - //details = info{ - // OrderID: info[0].OrderID, - // BalancePrice: info[0].BalancePrice, - // TotalPrice: info[0].TotalPrice, - // WxPrice: info[0].WxPrice, - // Status: info[0].Status, - //} + if err = GetRow(GetDB(), &info, sql, sqlParams); err != nil { + //return nil, err + details = &MixPayDetail{ + OrderID: info[0].OrderID, + BalancePrice: info[0].BalancePrice, + TotalPrice: info[0].TotalPrice, + WxPrice: info[0].WxPrice, + Status: info[0].Status, + } } - //globals.SugarLogger.Debug("输出mix pay信息", info.OrderID) return info[0], err }