作者 唐旭辉

bug修复

@@ -63,6 +63,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st @@ -63,6 +63,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
63 //获取权限 63 //获取权限
64 if ok := redisdata.ExistUserPermission(userid); !ok { 64 if ok := redisdata.ExistUserPermission(userid); !ok {
65 //尝试重数据库获取 65 //尝试重数据库获取
  66 + log.Debug("从数据库读取权限")
66 permissionMap, err := serverabc.GetUserPermission(usercompanyid, serverabc.M_SYSTEM_OPPORTUNITY) 67 permissionMap, err := serverabc.GetUserPermission(usercompanyid, serverabc.M_SYSTEM_OPPORTUNITY)
67 if err != nil { 68 if err != nil {
68 log.Debug("从数据库未获得对应权限 :%s", err) 69 log.Debug("从数据库未获得对应权限 :%s", err)
@@ -77,6 +78,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st @@ -77,6 +78,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
77 } 78 }
78 } else { 79 } else {
79 //使用缓存 80 //使用缓存
  81 + log.Debug("从缓存读取权限")
80 permissionObject, err = redisdata.GetUserPermission(userid, serverabc.M_SYSTEM_OPPORTUNITY) 82 permissionObject, err = redisdata.GetUserPermission(userid, serverabc.M_SYSTEM_OPPORTUNITY)
81 if err != nil { 83 if err != nil {
82 log.Debug("从缓存未获得对应权限 :%s", err) 84 log.Debug("从缓存未获得对应权限 :%s", err)
@@ -132,8 +134,10 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st @@ -132,8 +134,10 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
132 sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ","))) 134 sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ",")))
133 } 135 }
134 } 136 }
  137 + if len(usrPermission.CheckMap) > 0 {
  138 + sqlslice = append(sqlslice, sql5)
  139 + }
135 140
136 - sqlslice = append(sqlslice, sql5)  
137 return fmt.Sprintf(allsql, strings.Join(sqlslice, " UNION ")) 141 return fmt.Sprintf(allsql, strings.Join(sqlslice, " UNION "))
138 } 142 }
139 143