邀请关系列表新增按照邀请人数倒序
This commit is contained in:
parent
943ccb7c5d
commit
eeaa2caea0
@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||
@ -1098,12 +1099,16 @@ func GetInviteStaticList(in *artistInfoUser.GetInviteStaticListRequest) (res *ar
|
||||
Joins(fmt.Sprintf("LEFT JOIN %v su ON su.invited_code = ui.invite_code", model.User{}.TableName())).
|
||||
Joins((fmt.Sprintf("LEFT JOIN %v rn ON rn.id = su.real_name_id", model.RealName{}.TableName()))).
|
||||
Where("su.deleted_at=0").
|
||||
Group("ui.invite_code")
|
||||
Group("ui.invite_code") //HAVING count(ui.invited_code) >0
|
||||
if in.KeyWords != "" {
|
||||
orm = orm.Where("rn.name LIKE '%%?%%' OR su.tel_num LIKE '%%?%%' OR su.invited_code LIKE '%%?%%' ", in.KeyWords, in.KeyWords, in.KeyWords)
|
||||
}
|
||||
var datas []inviteStatic
|
||||
err = orm.Count(&res.Page.Total).Scopes(db.Pagination(in.Page, in.PageSize)).Find(&datas).Error
|
||||
//倒序排序
|
||||
sort.Slice(datas, func(i, j int) bool {
|
||||
return datas[i].InvitedCount < datas[j].InvitedCount
|
||||
})
|
||||
if len(datas) > 0 {
|
||||
for i, v := range datas {
|
||||
res.Data = append(res.Data, &artistInfoUser.GetInviteStaticListData{
|
||||
|
Loading…
Reference in New Issue
Block a user