|
@@ -232,24 +232,26 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
|
|
|
UserPowerMap["500"] = 1
|
|
|
}
|
|
|
//当前用户是否被分配权限
|
|
|
- entnichePowers := Mysql.SelectBySql(fmt.Sprintf(`SELECT a.product_type,a.ent_id FROM %s a LEFT JOIN %s b ON a.id = b.wait_empower_id WHERE b.status = 1 AND b.ent_user_id = ?`, EntnicheWaitEmpower, EntnichePower), m.EntUserId)
|
|
|
- if entnichePowers != nil && len(*entnichePowers) > 0 {
|
|
|
- for _, entnichePower := range *entnichePowers {
|
|
|
- //排除非当前企业分配的权限
|
|
|
- if MC.Int64All(entnichePower["ent_id"]) != m.EntId {
|
|
|
- productType := MC.ObjToString(entnichePower["product_type"])
|
|
|
- if strings.Contains(productType, "大会员") && len(serviceIds["M"]) > 0 {
|
|
|
- for _, v := range serviceIds["M"] {
|
|
|
- UserPowerMap[v] = 0
|
|
|
+ if m.EntUserId > 0 {
|
|
|
+ entnichePowers := Mysql.SelectBySql(fmt.Sprintf(`SELECT a.product_type,a.ent_id FROM %s a LEFT JOIN %s b ON a.id = b.wait_empower_id WHERE b.status = 1 AND b.ent_user_id = ?`, EntnicheWaitEmpower, EntnichePower), m.EntUserId)
|
|
|
+ if entnichePowers != nil && len(*entnichePowers) > 0 {
|
|
|
+ for _, entnichePower := range *entnichePowers {
|
|
|
+ //排除非当前企业分配的权限
|
|
|
+ if MC.Int64All(entnichePower["ent_id"]) != m.EntId {
|
|
|
+ productType := MC.ObjToString(entnichePower["product_type"])
|
|
|
+ if strings.Contains(productType, "大会员") && len(serviceIds["M"]) > 0 {
|
|
|
+ for _, v := range serviceIds["M"] {
|
|
|
+ UserPowerMap[v] = 0
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if strings.Contains(productType, "VIP订阅") && len(serviceIds["V"]) > 0 {
|
|
|
- for _, v := range serviceIds["V"] {
|
|
|
- UserPowerMap[v] = 0
|
|
|
+ if strings.Contains(productType, "VIP订阅") && len(serviceIds["V"]) > 0 {
|
|
|
+ for _, v := range serviceIds["V"] {
|
|
|
+ UserPowerMap[v] = 0
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|