|
@@ -26,22 +26,19 @@ func (a *Action) Info() {
|
|
rMap := map[string]interface{}{}
|
|
rMap := map[string]interface{}{}
|
|
switch module {
|
|
switch module {
|
|
case "tripartiteAuth":
|
|
case "tripartiteAuth":
|
|
- AdCode := fmt.Sprintf("ad_%s", module)
|
|
|
|
- obj := redis.Get("other", AdCode)
|
|
|
|
|
|
+ cacheKey := fmt.Sprintf("ad_%s", module)
|
|
|
|
+ obj := redis.Get("other", cacheKey)
|
|
var adInfo []AdInfo
|
|
var adInfo []AdInfo
|
|
if obj != nil {
|
|
if obj != nil {
|
|
adInfo = Handle(obj.([]interface{}), a.Request.Host)
|
|
adInfo = Handle(obj.([]interface{}), a.Request.Host)
|
|
} else {
|
|
} else {
|
|
- res, ok := public.MQFW.FindOneByField("ad", `{"s_code":"`+AdCode+`"}`, `{"a_son":1,"l_modifydate":1}`)
|
|
|
|
|
|
+ res, ok := public.MQFW.FindOneByField("ad", `{"s_code":"`+module+`"}`, `{"a_son":1,"l_modifydate":1}`)
|
|
if ok && res != nil && (*res)["a_son"] != nil {
|
|
if ok && res != nil && (*res)["a_son"] != nil {
|
|
- res, ok := public.MQFW.FindOneByField("ad", `{"s_code":"`+AdCode+`"}`, `{"a_son":1}`)
|
|
|
|
- if ok && res != nil && (*res)["a_son"] != nil {
|
|
|
|
- son := (*res)["a_son"].([]interface{})
|
|
|
|
- if len(son) > 0 {
|
|
|
|
- redis.Put("other", AdCode, son, int(GetLastTime()))
|
|
|
|
- }
|
|
|
|
- adInfo = Handle(son, a.Request.Host)
|
|
|
|
|
|
+ son := (*res)["a_son"].([]interface{})
|
|
|
|
+ if len(son) > 0 {
|
|
|
|
+ redis.Put("other", cacheKey, son, int(GetLastTime()))
|
|
}
|
|
}
|
|
|
|
+ adInfo = Handle(son, a.Request.Host)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if len(adInfo) > 0 {
|
|
if len(adInfo) > 0 {
|