|
|
|
|
@ -637,6 +637,11 @@ func Control(uid int, controlId int) error { |
|
|
|
|
rtp = specialControlRtp |
|
|
|
|
log.Debug("rtpControl special, uid:%d result:%s, rtp:%d", uid, result, specialControlRtp) |
|
|
|
|
} |
|
|
|
|
templateId := call.GetConfigRtpTemplateId() |
|
|
|
|
if templateId == "" && DefaultTemplateId != "" { |
|
|
|
|
log.Debug("sn cfg templateId is nil") |
|
|
|
|
templateId = DefaultTemplateId |
|
|
|
|
} |
|
|
|
|
req := &ControlReq{ |
|
|
|
|
BaseReq: BaseReq{ |
|
|
|
|
SnAccount: SnAccount, |
|
|
|
|
@ -646,7 +651,7 @@ func Control(uid int, controlId int) error { |
|
|
|
|
ControlId: controlId, |
|
|
|
|
Sn: SnId, |
|
|
|
|
AgentId: AgentId, |
|
|
|
|
TemplateId: DefaultTemplateId, |
|
|
|
|
TemplateId: templateId, |
|
|
|
|
Data: []struct { |
|
|
|
|
TargetRtp int `json:"target_rtp"` |
|
|
|
|
}{ |
|
|
|
|
@ -682,6 +687,7 @@ func InitGameControlTemplate() error { |
|
|
|
|
SnAccount: SnAccount, |
|
|
|
|
Time: time.Now().Unix(), |
|
|
|
|
}, |
|
|
|
|
PageSize: 100, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.Debug("sn get control template req, %+v", *req) |
|
|
|
|
@ -702,11 +708,22 @@ func InitGameControlTemplate() error { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, v := range resp.Data.List { |
|
|
|
|
if strings.Contains(v.Desc, "90%50") { |
|
|
|
|
v.Desc = strings.ReplaceAll(v.Desc, "倍", "") |
|
|
|
|
descList := strings.Split(v.Desc, "%") |
|
|
|
|
log.Debug("sn template desc:%s", descList) |
|
|
|
|
err = db.Mysql().C().Model(&common.ConfigRtpTemplate{}).Where("rtp = ? and max_odds = ?", util.ToInt(descList[0]), util.ToInt(descList[1])). |
|
|
|
|
Updates(map[string]interface{}{ |
|
|
|
|
"template_id": v.TemplateId, |
|
|
|
|
}).Error |
|
|
|
|
if err != nil { |
|
|
|
|
log.Error("update rtp template err, %s", err.Error()) |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if strings.Contains(v.Desc, "90%50倍") { |
|
|
|
|
DefaultTemplateId = v.TemplateId |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
call.LoadConfigRtpTemplate() |
|
|
|
|
|
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|