Browse Source

bug修改

wangfei 6 years ago
parent
commit
325952537d
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      models/system/user.go

+ 5
- 2
models/system/user.go View File

32
 type UserListInfo struct {
32
 type UserListInfo struct {
33
 	model.SysUser `xorm:"extends"`
33
 	model.SysUser `xorm:"extends"`
34
 	UserTypeNames string
34
 	UserTypeNames string
35
+	CaseName      string
35
 }
36
 }
36
 type CustomerInfo struct {
37
 type CustomerInfo struct {
37
 	model.TaCustomer `xorm:"extends"`
38
 	model.TaCustomer `xorm:"extends"`
41
 // GetUserList 用户列表
42
 // GetUserList 用户列表
42
 func (m *UserDAO) GetUserList(username, typeid, caseids string, page int, pageSize int) ([]UserListInfo, error) {
43
 func (m *UserDAO) GetUserList(username, typeid, caseids string, page int, pageSize int) ([]UserListInfo, error) {
43
 	var users []UserListInfo
44
 	var users []UserListInfo
44
-	sql := `select user.*,c.user_type_names from sys_user user left join (
45
+	sql := `select user.*,c.user_type_names,d.case_name from sys_user user left join (
45
 		select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
46
 		select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
46
 		INNER join td_user_type b on a.type_id = b.type_id
47
 		INNER join td_user_type b on a.type_id = b.type_id
47
-		group by a.user_id) c on user.user_id = c.user_id where user.user_id != '` + models.ADMIN_ID + `' and
48
+		group by a.user_id) c on user.user_id = c.user_id
49
+		LEFT JOIN sys_user_case d on user.user_id=d.user_id and d.is_belong = 1
50
+		where user.user_id != '` + models.ADMIN_ID + `' and
48
 		(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in 
51
 		(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in 
49
 		(select user_id from sys_user_case where is_belong=1 and case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
52
 		(select user_id from sys_user_case where is_belong=1 and case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
50
 
53