fix
This commit is contained in:
@@ -1,2 +1,16 @@
|
||||
package gmodel
|
||||
// TODO: 使用model的属性做你想做的
|
||||
|
||||
import "context"
|
||||
|
||||
// TODO: 使用model的属性做你想做的
|
||||
type GetAllUserWithDepartmentRsp struct {
|
||||
LdapUsers
|
||||
LdapDepartmentUsers
|
||||
}
|
||||
|
||||
func (u *LdapUsersModel) GetAllUserWithDepartment(ctx context.Context) (resp []GetAllUserWithDepartmentRsp, err error) {
|
||||
err = u.db.WithContext(ctx).Table(u.name + " as u").
|
||||
Joins("inner join `ldap_department_users` as du on u.id = du.user_id ").
|
||||
Select("u.*,du.*").Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user