This commit is contained in:
aozhiwei 2024-11-29 15:52:11 +08:00
parent 3492126047
commit d2a7e9d8d5

View File

@ -1,8 +1,10 @@
package service package service
import ( import (
"q5"
"f5" "f5"
"main/model" "main/model"
"main/vo"
"main/constant" "main/constant"
) )
@ -16,9 +18,15 @@ func (this *friend) init() {
func (this *friend) unInit() { func (this *friend) unInit() {
} }
func (this *friend) List(accountId string) (error, []*model.User) { func (this *friend) List(accountId string) (error, []*vo.Friend) {
friends := []*model.Friend{} friends := []*model.User{}
result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(new(model.Friend).TableName()).Where( result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(new(model.User).TableName()).Where(
"account_id = ? AND item_num > ?", accountId, 0).Find(&friends) "invited = ?", accountId).Find(&friends)
return result.Error, friends friendsVo := []*vo.Friend{}
for _, u := range(friends) {
friendVo := new(vo.Friend)
friendVo.FromModel(u)
q5.AppendSlice(&friendsVo, friendVo)
}
return result.Error, friendsVo
} }