Browse Source

fix: 赋值错误

zhangxinlei1996 1 year ago
parent
commit
945412b67f
1 changed files with 5 additions and 5 deletions
  1. 5 5
      ent/entity/entity.go

+ 5 - 5
ent/entity/entity.go

@@ -54,10 +54,10 @@ func (c *CurrentUser) EntInfo(entId, entUserId int) *CurrentUser {
 		Dept: &Department{},
 		Dept: &Department{},
 	}
 	}
 	currentUser.Ent = VarEntInfo.GetById(entId)
 	currentUser.Ent = VarEntInfo.GetById(entId)
-	user := Mysql.SelectBySql(`SELECT a.name as user_name,d.product_type,d.start_time,d.end_time,a.niche_dis from entniche_user a 
-		INNER JOIN entniche_user_role b on (a.id=? and b.role_id=? and a.id=b.user_id) 
-		left join entniche_power c on (c.status=1 and a.id=c.ent_user_id) 
-		left join entniche_wait_empower d on (d.end_time>? and a.ent_id=d.ent_id) 
+	user := Mysql.SelectBySql(`SELECT a.name as user_name,d.product_type,d.start_time,d.end_time,a.niche_dis from entniche_user a
+		INNER JOIN entniche_user_role b on (a.id=? and b.role_id=? and a.id=b.user_id)
+		left join entniche_power c on (c.status=1 and a.id=c.ent_user_id)
+		left join entniche_wait_empower d on (d.end_time>? and a.ent_id=d.ent_id)
 		limit 1`, entUserId, Role_admin_system, NowFormat(Date_Full_Layout))
 		limit 1`, entUserId, Role_admin_system, NowFormat(Date_Full_Layout))
 	if user != nil && len(*user) > 0 {
 	if user != nil && len(*user) > 0 {
 		currentUser.Role_admin_system = true
 		currentUser.Role_admin_system = true
@@ -99,7 +99,7 @@ func (c *CurrentUser) EntInfo(entId, entUserId int) *CurrentUser {
 		if r != nil && len(*r) == 1 {
 		if r != nil && len(*r) == 1 {
 			currentUser.User_name, _ = (*r)[0]["user_name"].(string)
 			currentUser.User_name, _ = (*r)[0]["user_name"].(string)
 			currentUser.User_power = qutil.IntAll((*r)[0]["user_power"])
 			currentUser.User_power = qutil.IntAll((*r)[0]["user_power"])
-			currentUser.NicheDis = qutil.IntAllDef((*user)[0]["niche_dis"], 0)
+			currentUser.NicheDis = qutil.IntAllDef((*r)[0]["niche_dis"], 0)
 			if qutil.IntAll((*r)[0]["role_id"]) == Role_admin_department {
 			if qutil.IntAll((*r)[0]["role_id"]) == Role_admin_department {
 				currentUser.Role_admin_department = true
 				currentUser.Role_admin_department = true
 				currentUser.NicheDis = 2 //部门管理员P364默认是部门商机分配管理员
 				currentUser.NicheDis = 2 //部门管理员P364默认是部门商机分配管理员