|
|
@@ -123,9 +123,10 @@ func EnterpriseUserListByCentralKitchenForSchoolV2(req md.EnterpriseUserListReq) |
|
|
|
sess.And("user_identity.identity = ?", enum2.UserIdentityForCentralKitchenForStudent) |
|
|
|
} |
|
|
|
var m []*db.UserWithUserIdentity |
|
|
|
count, err := sess. |
|
|
|
count, _ := sess. |
|
|
|
Join("LEFT", "user_identity", "user.id = user_identity.uid"). |
|
|
|
Limit(req.Limit, (req.Page-1)*req.Limit).GroupBy("user.id").FindAndCount(&m) |
|
|
|
resp.Total = count |
|
|
|
|
|
|
|
var userIdentitiesMap = map[string][]db.UserIdentityWithClass{} |
|
|
|
userIdentityDb := db.UserIdentityDb{} |
|
|
@@ -140,19 +141,18 @@ func EnterpriseUserListByCentralKitchenForSchoolV2(req md.EnterpriseUserListReq) |
|
|
|
} |
|
|
|
} |
|
|
|
fmt.Println("!!!!!!!!!") |
|
|
|
resp.Total = count |
|
|
|
classWithUserDb := db.ClassWithUserDb{} |
|
|
|
classWithUserDb.Set() |
|
|
|
for _, v := range m { |
|
|
|
temp := md.EnterpriseUserListByCentralKitchenForSchoolStruct{ |
|
|
|
Id: v.User.Id, |
|
|
|
Nickname: v.Nickname, |
|
|
|
Phone: v.Phone, |
|
|
|
Avatar: v.Avatar, |
|
|
|
IsTeacher: 0, |
|
|
|
CreateAt: v.User.CreateAt, |
|
|
|
} |
|
|
|
for _, v1 := range userIdentitiesMap[utils.IntToStr(v.User.Id)] { |
|
|
|
temp.Nickname = v1.User.Nickname |
|
|
|
temp.Phone = v1.User.Phone |
|
|
|
temp.Avatar = v1.User.Avatar |
|
|
|
temp.CreateAt = v1.User.CreateAt |
|
|
|
//TODO::判断是否为老师 |
|
|
|
if v1.Identity == enum2.UserIdentityForCentralKitchenForTeacher { |
|
|
|
temp.UserIdentities = append(temp.UserIdentities, struct { |
|
|
|