pay
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user