Explorar el Código

feat:老版商机管理 统一订阅模式

wangshan hace 2 años
padre
commit
236bff1426
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      entity/user.go

+ 7 - 1
entity/user.go

@@ -115,7 +115,7 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			}
 			//当前企业id
 			if m.EntId > 0 {
-				entNicheInfos := Mysql.SelectBySql(`SELECT i.status,i.isNew,i.power_source,r.role_id,u.power FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id)  LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone = ? and i.id = ? ORDER BY r.role_id,i.isNew DESC`, phone, m.EntId)
+				entNicheInfos := Mysql.SelectBySql(`SELECT i.status,i.isNew,i.power_source,r.role_id,u.power,i.model FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id)  LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone = ? and i.id = ? `, phone, m.EntId)
 				//商机管理用户信息判断
 				if entNicheInfos != nil && len(*entNicheInfos) > 0 {
 					entNicheInfo := (*entNicheInfos)[0]
@@ -145,6 +145,12 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 								case 1: //企业管理员
 									UserPowerMap["102"] = 1
 								}
+								//老版商机管理: model:1-统一订阅,2-个人订阅
+								if MC.IntAll(entNicheInfo["model"]) == 1 {
+									UserPowerMap["103"] = 1
+								} else if MC.IntAll(entNicheInfo["model"]) == 2 {
+									UserPowerMap["104"] = 1
+								}
 							}
 						case 1:
 							//客户管理服务(商机管理服务) [前提:大会员、超级订阅、医械通用户]---免费用户也可以用 (需求调整来自刘苗:产品已确认)