Browse Source

日志添加

WH01243 2 years ago
parent
commit
0448bdc6be
1 changed files with 8 additions and 1 deletions
  1. 8 1
      service/chat_group.go

+ 8 - 1
service/chat_group.go

@@ -5,6 +5,8 @@ import (
 	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
 	IC "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/init"
 	"fmt"
+	"log"
+	"time"
 )
 
 type ChatGroupService struct{}
@@ -14,6 +16,7 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 	phoneData := map[string]string{}
 	nameData := map[string]string{}
 	positionData := map[int]string{}
+	tm := time.Now()
 	//在职人员查询
 	personList := IC.MainMysql.SelectBySql(fmt.Sprintf(`SELECT a.phone,IF(a.name = "我" AND b.role_id = 1 ,"%s",a.name)  AS name,b.role_id FROM %s a
 					LEFT JOIN entniche_user_role b on a.id = b.user_id 
@@ -24,6 +27,8 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 			nameData[common.InterfaceToStr(v["name"])] = common.InterfaceToStr(v["phone"])
 		}
 	}
+	log.Println("查询列表耗时5:", time.Since(tm))
+
 	//离职人员查看
 	if isAll {
 		departData, _ := IC.Mgo.Find(util.ENTNICHE_DELETE, map[string]interface{}{
@@ -36,6 +41,8 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 				nameData[common.InterfaceToStr(v["name"])] = common.InterfaceToStr(v["phone"])
 			}
 		}
+		log.Println("查询列表耗时6:", time.Since(tm))
+
 		//查询企业人员职位
 		positionList := IC.BaseMysql.SelectBySql("SELECT a.phone,b.id FROM base_user a LEFT JOIN base_position b ON a.id = b.user_id WHERE b.ent_id = ?", entId)
 		if positionList != nil && len(*positionList) > 0 {
@@ -44,7 +51,7 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 			}
 		}
 	}
-
+	log.Println("查询列表耗时7:", time.Since(tm))
 	return phoneData, nameData, positionData
 }