aa
This commit is contained in:
@@ -96,6 +96,8 @@ func Update(db *sqlx.DB, obj interface{}, fields ...string) (err error) {
|
|||||||
} else {
|
} else {
|
||||||
sqlParams = append(sqlParams, direct.Field(0).Int())
|
sqlParams = append(sqlParams, direct.Field(0).Int())
|
||||||
}
|
}
|
||||||
|
fmt.Println(sql.String())
|
||||||
|
fmt.Println(sqlParams)
|
||||||
_, err = db.DB.Exec(sql.String(), sqlParams...)
|
_, err = db.DB.Exec(sql.String(), sqlParams...)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-print/putils"
|
"git.rosy.net.cn/jx-print/putils"
|
||||||
"git.rosy.net.cn/jx-print/services/api"
|
"git.rosy.net.cn/jx-print/services/api"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -48,9 +47,7 @@ var (
|
|||||||
}
|
}
|
||||||
result, err := api.TLpayAPI.CreateUnitorderOrder(param)
|
result, err := api.TLpayAPI.CreateUnitorderOrder(param)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var result2 tonglianpayapi.PayInfo
|
order.PrepayID = result.PayInfo
|
||||||
json.Unmarshal([]byte(result.PayInfo), &result2)
|
|
||||||
order.PrepayID = result2.Package[strings.LastIndex(result2.Package, "=")+1 : len(result2.Package)]
|
|
||||||
order.TransactionID = result.TrxID
|
order.TransactionID = result.TrxID
|
||||||
err = dao.Update(db, order, "prepay_id", "transaction_id")
|
err = dao.Update(db, order, "prepay_id", "transaction_id")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user