add pay
This commit is contained in:
@@ -11,12 +11,12 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func AddMixPay(txDB orm.TxOrmer, orderID string, balancePrice, totalPrice, method int) error {
|
||||
func AddMixPay(txDB orm.TxOrmer, orderID string, balancePrice, totalPrice, status int) error {
|
||||
mixPayInfo := &model.MixPay{
|
||||
OrderID: orderID,
|
||||
BalancePrice: balancePrice,
|
||||
TotalPrice: totalPrice,
|
||||
Method: method,
|
||||
Status: status,
|
||||
WxPrice: totalPrice - balancePrice,
|
||||
}
|
||||
dao.WrapAddIDCULEntity(mixPayInfo, jxcontext.AdminCtx.GetUserName())
|
||||
@@ -62,11 +62,6 @@ func AddUserBillDb(db *dao.DaoDB, billID int64, userID string) (err error) {
|
||||
return dao.CreateEntity(db, userBillInsert)
|
||||
}
|
||||
|
||||
//
|
||||
//func AddExpendMixPay(txDB orm.TxOrmer, userBill *model.UserBill, billType, price, jobID int) (err error) {
|
||||
//err=AddMixPay()
|
||||
//}
|
||||
|
||||
func GetUserBillDetail(ctx *jxcontext.Context, userID, fromTime, toTime string, pageSize, offset int) (pagedInfo *model.PagedInfo, err error) {
|
||||
return dao.GetUserBillDetail(dao.GetDB(), userID, utils.Str2Time(fromTime), utils.Str2Time(toTime), pageSize, offset)
|
||||
}
|
||||
|
||||
@@ -311,6 +311,14 @@ func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if order.PayMethod == 5 || order.PayMethod == 2 {
|
||||
//更新order状态
|
||||
order.Status = 110 //支付成功
|
||||
if _, err := dao.UpdateEntityTx(txdb, &order, "Status"); err != nil {
|
||||
dao.Rollback(db, txdb)
|
||||
return err
|
||||
}
|
||||
}
|
||||
dao.Commit(db, txdb)
|
||||
if call.TrxStatus == tonglianpayapi.TrxStatusSuccess {
|
||||
switch order.OrderType {
|
||||
|
||||
Reference in New Issue
Block a user