Forráskód Böngészése

Merge branch 'dev/v1.2.6_wh' of SocialPlatform/messageCenter into feature/v1.2.6

王浩 2 éve
szülő
commit
2220a7c5b9
2 módosított fájl, 9 hozzáadás és 2 törlés
  1. 8 1
      service/chat_group.go
  2. 1 1
      service/message_mail_box.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{}{
@@ -40,6 +45,8 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 				}
 			}
 		}
+		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 {
@@ -48,7 +55,7 @@ func EntPerson(entId int64, isAll bool) (map[string]string, map[string]string, m
 			}
 		}
 	}
-
+	log.Println("查询列表耗时7:", time.Since(tm))
 	return phoneData, nameData, positionData
 }
 

+ 1 - 1
service/message_mail_box.go

@@ -596,7 +596,7 @@ func UserSynchronousList(customerServiceId, userId, entId, messageId int64, crea
 	create_time := nowForm.Format(util.Date_Full_Layout)
 	//查看汇总表
 	IC.BaseMysql.ExecTx("更新汇总表", func(tx *sql.Tx) bool {
-		data := IC.BaseMysql.SelectBySqlByTx(tx, "select * from customer_service_access where  ent_id=? and   user_id=? for  update ", entId, userId)
+		data := IC.BaseMysql.SelectBySqlByTx(tx, "select customer_service_access from socialize_summary where  ent_id=? and   user_id=? for  update ", entId, userId)
 		//data := FindOne(util.SOCIALIZE_SUMMARY, map[string]interface{}{"user_id": userId, "ent_id": entId}, "customer_service_access", "")
 		customer_service_access := 0
 		if data != nil && len(*data) > 0 {