瀏覽代碼

feat:商机管理服务管理员

wangshan 2 年之前
父節點
當前提交
2b9afc7dab
共有 1 個文件被更改,包括 12 次插入6 次删除
  1. 12 6
      entity/user.go

+ 12 - 6
entity/user.go

@@ -70,7 +70,6 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			//商机管理服务 前提是超级订阅、大会员、医械通
 			domainBool          = false
 			registerTime  int64 = 0
-			powerSource         = 0
 			entnichePower       = false //企业级服务 企业管理员
 		)
 		phone, _ := MC.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
@@ -125,11 +124,9 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 					if MC.IntAll(entNicheInfo["status"]) == 1 && MC.IntAll(entNicheInfo["power"]) == 1 {
 						isFree = false
 						//商机管理服务 P259需求
-						powerSource = MC.IntAll(entNicheInfo["power_source"])
-						//客户管理服务(商机管理服务) [前提:大会员、超级订阅、医械通用户]
-						//有商机管理服务 不会再有商机管理订阅菜单
-						if UserPowerMap["600"] = MC.If(powerSource > 0 && domainBool, 1, 0).(int); UserPowerMap["600"] == 0 {
-							//entNicheInfo := (*entNicheInfos)[0]
+						switch MC.IntAll(entNicheInfo["power_source"]) {
+						case 0:
+							//有商机管理服务 不会再有商机管理订阅菜单
 							switch MC.IntAll(entNicheInfo["isNew"]) {
 							case 1: //新版商机管理
 								UserPowerMap["110"] = 1
@@ -148,6 +145,15 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 									UserPowerMap["102"] = 1
 								}
 							}
+						case 1:
+							//客户管理服务(商机管理服务) [前提:大会员、超级订阅、医械通用户]---免费用户也可以用 (需求调整来自刘苗:产品已确认)
+							UserPowerMap["600"] = 1
+							switch MC.IntAll(entNicheInfo["role_id"]) {
+							case 2: //部门管理员
+								UserPowerMap["602"] = 1
+							case 1: //企业管理员
+								UserPowerMap["601"] = 1
+							}
 						}
 					}
 				}