diff --git a/cmd/internal/logic/artistinfo_artwork.go b/cmd/internal/logic/artistinfo_artwork.go index 8b9afbc..44b2ea3 100644 --- a/cmd/internal/logic/artistinfo_artwork.go +++ b/cmd/internal/logic/artistinfo_artwork.go @@ -14,6 +14,7 @@ import ( "github.com/fonchain/fonchain-artistinfo/cmd/model" "github.com/fonchain/fonchain-artistinfo/pb/artist" "github.com/fonchain/fonchain-artistinfo/pb/artistInfoArtwork" + "github.com/fonchain/fonchain-artistinfo/pb/artistInfoUser" "github.com/fonchain/fonchain-artistinfo/pb/artwork_query" "github.com/fonchain/fonchain-artistinfo/pkg/m" "github.com/fonchain/fonchain-artistinfo/pkg/service" @@ -207,30 +208,41 @@ func (a ArtistInfoArtworkLogic) GenerateArtworkSupplementInfo(request *artistInf } func (a ArtistInfoArtworkLogic) ArtworkStatic(request *artistInfoArtwork.ArtistArtworkStaticRequest) (res *artistInfoArtwork.ArtistArtworkStaticResponse, err error) { + //查询画家宝中认证成功的用户 + userList, _, err := dao.GetViewUserList(&artistInfoUser.FindUsersRequest{ + ArtistRealName: request.ArtistKeyWords, + Page: int32(request.Page), + PageSize: int32(request.PageSize), + IsArtist: true, + }) + if err != nil { + return nil, err + } + if userList == nil || len(userList) == 0 { + return nil, nil + } + var artistUids []string + for _, v := range userList { + artistUids = append(artistUids, v.ArtistUid) + } + //查询对应的画家信息 var gender int32 = -1 if request.ArtistGender != 1 { gender = 0 - } - if request.ArtistGender != 2 { + } else if request.ArtistGender != 2 { gender = 1 } //查询匹配的画家数据列表 artistList, err := service.GrpcArtistImpl.ArtistList(context.Background(), &artist.ArtistListRequest{ Keyword: request.ArtistKeyWords, - Page: int32(request.Page), - PageSize: int32(request.PageSize), + Page: 1, + PageSize: -1, Gender: gender, + Uids: artistUids, }) if err != nil { return nil, err } - if artistList.Data == nil || len(artistList.Data) == 0 { - return nil, nil - } - var artistUids []string - for _, v := range artistList.Data { - artistUids = append(artistUids, v.Uid) - } fmt.Println("\n artistUids:", artistUids, "\n") //查询这些画家审核通过的画作数据统计