wangshan 2 anni fa
parent
commit
185c645a8b
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      entity/user.go

+ 5 - 1
entity/user.go

@@ -3,6 +3,7 @@ package entity
 import (
 	"encoding/json"
 	"fmt"
+	"log"
 	"strconv"
 	"strings"
 	"sync"
@@ -78,6 +79,7 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			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)
 				//商机管理用户信息判断
+				log.Println("entNicheInfos:", entNicheInfos)
 				if entNicheInfos != nil && len(*entNicheInfos) > 0 {
 					isFree = false
 					entNicheInfo := (*entNicheInfos)[0]
@@ -170,7 +172,9 @@ func (m *WorkDesktopMenu) AutoUserPowerInfo() map[string]int {
 			//客户管理服务(商机管理服务) [前提:大会员、超级订阅、医械通用户]
 			UserPowerMap["600"] = MC.If(powerSource > 0 && domainBool, 1, 0).(int)
 			//必须是企业管理员-&-购买了企业级应用服务
-			if c := Mysql.CountBySql(fmt.Sprintf(`SELECT COUNT(id) FROM %s WHERE ent_id = ? AND TO_DAYS(end_time) >= TO_DAYS(NOW())`, EntnicheWaitEmpower), m.EntId); c > 0 && entnichePower {
+			c := Mysql.CountBySql(fmt.Sprintf(`SELECT COUNT(id) FROM %s WHERE ent_id = ? AND TO_DAYS(end_time) >= TO_DAYS(NOW())`, EntnicheWaitEmpower), m.EntId)
+			log.Println(entnichePower, "cccccc:", c)
+			if c > 0 && entnichePower {
 				UserPowerMap["700"] = 1
 			}
 			//领域化产品权限