1
This commit is contained in:
parent
3492126047
commit
d2a7e9d8d5
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user