Selaa lähdekoodia

Merge branch 'dev/1.1.25_wh' of BaseService/jyMicroservices into feature/v1.1.25

王浩 2 vuotta sitten
vanhempi
commit
d5a462d6d2
1 muutettua tiedostoa jossa 9 lisäystä ja 7 poistoa
  1. 9 7
      jyBXCore/rpc/service/participateStatistics.go

+ 9 - 7
jyBXCore/rpc/service/participateStatistics.go

@@ -292,10 +292,12 @@ func JsonUnmarshal(m interface{}, s interface{}) interface{} {
 
 // 获取部门下可以进行分发的人员(不包含部门名称和部门id)
 func GetDisUsers(entId, deptId int) *[]map[string]interface{} {
-	r := IC.MainMysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,c.power,b.dept_id from entniche_department_parent a 
+	r := IC.MainMysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,c.power,b.dept_id,d.name as dept_name
+		from entniche_department_parent a 
 		INNER JOIN entniche_department_user b on (b.dept_id=? or (a.pid=? and a.id=b.dept_id)) 
 		INNER JOIN entniche_user c on (c.ent_id=? and b.user_id=c.id) 
-		order by convert(c.name using gbk) COLLATE gbk_chinese_ci asc`, deptId, deptId, entId)
+		INNER JOIN entniche_department d  on  d.id=b.dept_id
+		order by b.dept_id , convert(c.name using gbk) COLLATE gbk_chinese_ci asc`, deptId, deptId, entId)
 	return r
 }
 func GetUser(entUserIdArr []string) *[]map[string]interface{} {
@@ -359,21 +361,21 @@ func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string) []
 	query := []string{}
 	if isAdmin {
 		//是管理员
-		query = append(query, fmt.Sprintf(" ent_user_id in (%s)", personArrStr))
+		query = append(query, fmt.Sprintf(" ent_user_id in (%s) ", personArrStr))
 	} else {
 		//不是管理员
-		query = append(query, fmt.Sprintf(" position_id = %d", personArrStr))
+		query = append(query, fmt.Sprintf(" position_id = %d ", personArrStr))
 	}
 	if startTime == 0 && endTime == 0 {
 		//没有传时间,默认时间处理
 		var start = time.Now().AddDate(0, 0, -30)
-		query = append(query, fmt.Sprintf(" ymd >= %s", start.Format("20060102")))
+		query = append(query, fmt.Sprintf(" ymd >= %s ", start.Format("20060102")))
 	}
 	if startTime != 0 {
-		query = append(query, fmt.Sprintf(" ymd >= %d", startTime))
+		query = append(query, fmt.Sprintf(" ymd >= %d ", startTime))
 	}
 	if endTime != 0 {
-		query = append(query, fmt.Sprintf(" ymd <= %d", endTime))
+		query = append(query, fmt.Sprintf(" ymd <= %d ", endTime))
 	}
 	return query
 }