Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

adv_callback
huangjiajun 4 viikkoa sitten
vanhempi
commit
7d720aa8be
1 muutettua tiedostoa jossa 41 lisäystä ja 13 poistoa
  1. +41
    -13
      app/hdl/hdl_wallet.go

+ 41
- 13
app/hdl/hdl_wallet.go Näytä tiedosto

@@ -252,8 +252,10 @@ func WithdrawApply(c *gin.Context) {

//4、新增提现记录
now := time.Now()
id := utils.StrToInt64(utils.OrderUUID(int(user.Id)))
finWithdrawApplyDb := implement.NewFinWithdrawApplyDb(db.Db)
finWithdrawApply := &model.FinWithdrawApply{
Id: id,
Uid: user.Id,
AdmId: 0,
Amount: req.Amount,
@@ -504,23 +506,49 @@ func BindAlipayAccount(c *gin.Context) {
e.OutErr(c, e.ERR, err.Error())
return
}
now := time.Now()
m := model.AlipayUserInfo{
Uid: user.Id,
UserId: info.Response.UserId,
OpenId: info.Response.OpenId,
AppId: client.AppId,
UserName: info.Response.NickName,
Ext: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
infoDb := implement.NewAlipayUserInfoDb(db.Db)
_, err = infoDb.AlipayUserInfoInsert(&m)
userInfo, err := infoDb.GetAlipayUserInfo(user.Id)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
e.OutErr(c, e.ERR, err.Error())
return
}
now := time.Now()
if userInfo == nil {
m := model.AlipayUserInfo{
Uid: user.Id,
UserId: info.Response.UserId,
OpenId: info.Response.OpenId,
AppId: client.AppId,
UserName: info.Response.NickName,
Ext: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = infoDb.AlipayUserInfoInsert(&m)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
} else {
cols := []string{"open_id", "app_id", "user_id", "user_name"}
m := model.AlipayUserInfo{
Id: userInfo.Id,
Uid: userInfo.Uid,
UserId: info.Response.UserId,
OpenId: info.Response.OpenId,
AppId: client.AppId,
UserName: info.Response.NickName,
Ext: "",
CreateAt: userInfo.CreateAt,
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err := infoDb.UpdateAlipayUserInfo(&m, cols...)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
}

e.OutSuc(c, "success", nil)
}



Ladataan…
Peruuta
Tallenna