|
@@ -918,16 +918,24 @@ func (this *DataExport) GetPcEntAuth() {
|
|
|
myEntMenu := false
|
|
|
entnicheMenu := false
|
|
|
pcUsers := map[int]bool{}
|
|
|
- for _, v := range config.Sysconfig["entnichePcUser"].([]interface{}) {
|
|
|
- pcUsers[util.IntAll(v)] = true
|
|
|
+ hideUsers := map[int]bool{}
|
|
|
+ for _, v := range config.EntnichePcConf.EntnichePcUser {
|
|
|
+ pcUsers[v] = true
|
|
|
+ }
|
|
|
+ for _, v := range config.EntnichePcConf.HideEntnicheMenu {
|
|
|
+ hideUsers[v] = true
|
|
|
}
|
|
|
if phone != "" {
|
|
|
ent := public.Mysql.SelectBySql("select id,phone from entniche_info where phone=? and status=1", phone)
|
|
|
- if len(*ent) != 0 {
|
|
|
+ if ent != nil && len(*ent) != 0 {
|
|
|
for _, val := range *ent {
|
|
|
- if pcUsers[util.IntAll((val)["id"])] {
|
|
|
- entnicheMenu = true
|
|
|
+ if pcUsers[util.IntAll(val["id"])] {
|
|
|
myEntMenu = true
|
|
|
+ if hideUsers[util.IntAll(val["id"])] {
|
|
|
+ entnicheMenu = false
|
|
|
+ } else {
|
|
|
+ entnicheMenu = true
|
|
|
+ }
|
|
|
break
|
|
|
}
|
|
|
}
|
|
@@ -937,19 +945,22 @@ func (this *DataExport) GetPcEntAuth() {
|
|
|
if user != nil && len(*user) > 0 {
|
|
|
for _, v := range *user {
|
|
|
if pcUsers[util.IntAll(v["ent_id"])] {
|
|
|
- ents := public.Mysql.SelectBySql("select status from entniche_info where id=?", util.IntAll(v["ent_id"]))
|
|
|
- if len(*ents) != 0 {
|
|
|
+ ents := public.Mysql.SelectBySql("select status,id from entniche_info where id=?", util.IntAll(v["ent_id"]))
|
|
|
+ if ents != nil && len(*ents) != 0 {
|
|
|
for _, vv := range *ents {
|
|
|
if util.IntAll(vv["status"]) == 1 {
|
|
|
myEntMenu = true
|
|
|
- break
|
|
|
+ }
|
|
|
+ if util.IntAll(v["power"]) == 1 {
|
|
|
+ if hideUsers[util.IntAll(vv["id"])] {
|
|
|
+ entnicheMenu = false
|
|
|
+ } else {
|
|
|
+ entnicheMenu = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if util.IntAll(v["power"]) == 1 {
|
|
|
- entnicheMenu = true
|
|
|
- break
|
|
|
- }
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
}
|