|
|
@@ -66,6 +66,53 @@ func GetRealNameAuthBase(c *gin.Context) { |
|
|
|
e.OutSuc(c, res, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
func GetRealNameAuthState(c *gin.Context) { |
|
|
|
var res = &md.RealNameAuthBasicData{ |
|
|
|
AuthState: "0", |
|
|
|
IsNeedGetEnergy: "1", |
|
|
|
TipStr: "请前往蛋蛋乐园获取能量", |
|
|
|
} |
|
|
|
res.AuthState = "0" |
|
|
|
//判断审核状态 |
|
|
|
eg := db.Db |
|
|
|
user := GetUser(c) |
|
|
|
egg_system_rules.Init(cfg.RedisAddr) |
|
|
|
amount := GetSysCfgStr("user_real_name_money") |
|
|
|
_, can := egg_energy.CheckActivityCoinToAlipayRealName(db.Db, user.Id, amount) |
|
|
|
if can { |
|
|
|
res.IsNeedGetEnergy = "0" |
|
|
|
} |
|
|
|
NewUserRealNameAuthDb := implement.NewUserRealNameAuthDb(eg) |
|
|
|
list, _ := NewUserRealNameAuthDb.GetRealNameAuthByUid(utils.Int64ToStr(user.Id)) |
|
|
|
if list != nil { |
|
|
|
//如果是审核中的订单,判断是否人脸识别 调用人脸识别获取结果 |
|
|
|
if list.State != 1 && list.CertifyId != "" { |
|
|
|
state, _, _, err := GetCertifyQuery(c, utils.Int64ToStr(user.Id)) |
|
|
|
if err == nil { |
|
|
|
list.State = state |
|
|
|
} |
|
|
|
} |
|
|
|
res.AuthState = utils.IntToStr(list.State) |
|
|
|
if list.State == 0 { //人脸识别 支付了但是没扫脸的情况 设置成没审核状态 |
|
|
|
res.AuthState = "0" |
|
|
|
} |
|
|
|
if list.IsPay == 0 { |
|
|
|
res.AuthState = "0" |
|
|
|
} |
|
|
|
if list.IsPay == 1 { |
|
|
|
res.IsNeedGetEnergy = "0" |
|
|
|
} |
|
|
|
} |
|
|
|
if res.AuthState == "1" { |
|
|
|
res.IsNeedGetEnergy = "0" |
|
|
|
if user.IsRealName == 0 { |
|
|
|
user.IsRealName = 1 |
|
|
|
eg.Where("id=?", user.Id).Cols("is_real_name").Update(user) |
|
|
|
} |
|
|
|
} |
|
|
|
e.OutSuc(c, res, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func RealNameSave(c *gin.Context) { |
|
|
|
var args md.RealNameAuthAddRequest |
|
|
|