|
@@ -32,6 +32,7 @@ func NewUserDAO(ctx *utils.Context) *UserDAO {
|
32
|
32
|
type UserListInfo struct {
|
33
|
33
|
model.SysUser `xorm:"extends"`
|
34
|
34
|
UserTypeNames string
|
|
35
|
+ CaseName string
|
35
|
36
|
}
|
36
|
37
|
type CustomerInfo struct {
|
37
|
38
|
model.TaCustomer `xorm:"extends"`
|
|
@@ -41,10 +42,12 @@ type CustomerInfo struct {
|
41
|
42
|
// GetUserList 用户列表
|
42
|
43
|
func (m *UserDAO) GetUserList(username, typeid, caseids string, page int, pageSize int) ([]UserListInfo, error) {
|
43
|
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
|
46
|
select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
|
46
|
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
|
51
|
(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in
|
49
|
52
|
(select user_id from sys_user_case where is_belong=1 and case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
|
50
|
53
|
|