err:=db.DB.MysqlDB.DefaultGormDB().Table("groups").Select("groups.*, (select count(*) from group_members where group_members.group_id=groups.group_id) as num").
varcountint64
Where(" name like ? and status != ?",fmt.Sprintf("%%%s%%",groupName),constant.GroupStatusDismissed).Limit(int(showNumber)).Offset(int(showNumber*(pageNumber-1))).Find(&groups).Error
sql:=db.DB.MysqlDB.DefaultGormDB().Table("groups").Select("groups.*, (select count(*) from group_members where group_members.group_id=groups.group_id) as num").
returngroups,err
Where(" name like ? and status != ?",fmt.Sprintf("%%%s%%",groupName),constant.GroupStatusDismissed)