Browse Source

导出文件

kobe6258 5 months ago
parent
commit
e3591efd03
1 changed files with 9 additions and 7 deletions
  1. 9 7
      models/user.go

+ 9 - 7
models/user.go

@@ -71,13 +71,7 @@ func GetPageOfficialUserList(condition string, pars []interface{}, sortStr strin
 	if userList == nil {
 		userList = []*UserView{}
 	}
-	for _, item := range userList {
-		if item.FollowingGzh {
-			item.FollowingGzhStr = "是"
-		} else {
-			item.FollowingGzhStr = "否"
-		}
-	}
+
 	return
 }
 
@@ -101,6 +95,14 @@ func GetPageOfficialUserByCondition(condition string, pars []interface{}, sortSt
 	_, err = o.Raw(sql, officialIds, pars).QueryRows(&userList)
 	if userList == nil {
 		userList = []UserView{}
+		return
+	}
+	for i := 0; i < len(userList); i++ {
+		if userList[i].FollowingGzh {
+			userList[i].FollowingGzhStr = "是"
+		} else {
+			userList[i].FollowingGzhStr = "否"
+		}
 	}
 	return
 }