|
|
@@ -160,6 +160,26 @@ func WithdrawApply(c *gin.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
user := svc.GetUser(c) |
|
|
|
//1. 判断是否为第一次提现 |
|
|
|
isFirst := false |
|
|
|
has, err := db.Db.Where("uid = ?", user.Id). |
|
|
|
Get(model.FinWithdrawApply{}) |
|
|
|
if !has { //第一次提现 |
|
|
|
isFirst = true |
|
|
|
} |
|
|
|
settingDb := implement.NewFinWithdrawSettingDb(db.Db) |
|
|
|
setting, err := settingDb.FinWithdrawSettingGetOne() |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err) |
|
|
|
return |
|
|
|
} |
|
|
|
resp := svc.GetWithdrawCondition(user, setting, isFirst) |
|
|
|
//判断实名 |
|
|
|
IsRealName := svc.CheckRealName(user.Id) |
|
|
|
if IsRealName != "1" && resp.IsNeedRealName { |
|
|
|
e.OutErr(c, 400, e.NewErr(400, "请先前往实名认证")) |
|
|
|
return |
|
|
|
} |
|
|
|
var userId, openId string |
|
|
|
var kind int |
|
|
|
//sysCfgDb := implement.NewSysCfgDb(db.Db, cache.GetPool().Get()) |
|
|
@@ -346,9 +366,12 @@ func GetWithdrawCondition(c *gin.Context) { |
|
|
|
if !has { //第一次提现 |
|
|
|
isFirst = true |
|
|
|
} |
|
|
|
|
|
|
|
resp := svc.GetWithdrawCondition(user, setting, isFirst) |
|
|
|
|
|
|
|
//判断实名 |
|
|
|
IsRealName := svc.CheckRealName(user.Id) |
|
|
|
if IsRealName == "1" && resp.IsNeedRealName { |
|
|
|
resp.IsNeedRealName = false |
|
|
|
} |
|
|
|
alipayUserInfoDb := implement.NewAlipayUserInfoDb(db.Db) |
|
|
|
alipayInfo, err := alipayUserInfoDb.GetAlipayUserInfo(user.Id) |
|
|
|
if err != nil { |
|
|
|