adduserbill

This commit is contained in:
苏尹岚
2020-10-15 08:58:36 +08:00
parent 1482ff8cee
commit 1d56ce77f7
2 changed files with 9 additions and 6 deletions

View File

@@ -54,12 +54,7 @@ func Pay(ctx *jxcontext.Context, orderID, payType int, vendorPayType string) (er
//如果用户没有对应账单信息就给他生成一条 //如果用户没有对应账单信息就给他生成一条
userBill, err := dao.GetUserBill(db, order.UserID, "") userBill, err := dao.GetUserBill(db, order.UserID, "")
if userBill == nil { if userBill == nil {
userBillInsert := &model.UserBill{ err = financial.AddUserBill(db, jxutils.GenBillID(), order.UserID)
BillID: jxutils.GenBillID(),
UserID: order.UserID,
}
dao.WrapAddIDCULDEntity(userBillInsert, jxcontext.AdminCtx.GetUserName())
err = dao.CreateEntity(db, userBillInsert)
} }
err = payHandler.CreatePay() err = payHandler.CreatePay()
return err return err

View File

@@ -25,3 +25,11 @@ func AddBillExpend(db *dao.DaoDB, billID int64, billType, expendPrice int) (err
dao.WrapAddIDCULEntity(billExpend, jxcontext.AdminCtx.GetUserName()) dao.WrapAddIDCULEntity(billExpend, jxcontext.AdminCtx.GetUserName())
return dao.CreateEntity(db, billExpend) return dao.CreateEntity(db, billExpend)
} }
func AddUserBill(db *dao.DaoDB, billID int64, userID string) (err error) {
userBillInsert := &model.UserBill{
BillID: billID,
UserID: userID,
}
dao.WrapAddIDCULDEntity(userBillInsert, jxcontext.AdminCtx.GetUserName())
return dao.CreateEntity(db, userBillInsert)
}