Merge branch 'xjjdev'

This commit is contained in:
徐俊杰 2023-03-29 23:08:49 +08:00
commit 129332ce1d

View File

@ -294,17 +294,21 @@ func CountArtworkTotalWhichAuditPassed(artistUid string) (rulerPassedTotal int64
// CountAllArtworkTotal 单个统计画家所有的画作数量和平尺数
func CountAllArtworkTotal(artistUid string) (artworkTotal int64, artworkRulerTotal int64) {
//查询画家宝中的画作总数
var artworkUids []string
db.DB.Model(model.ArtworkLockRecord{}).Where("artist_uid = ?", artistUid).Pluck("artwork_uid", &artworkUids)
artworkTotal = int64(len(artworkUids))
//查询此画家的所有画作
artworkList, err := service.ArtworkQueryImpl.ArtworkList(context.Background(), &artwork_query.ArtworkListRequest{
Page: 1,
PageSize: -1,
ArtistUid: artistUid,
artworkList, err := service.ArtworkQueryImpl.ArtworkPreviewList(context.Background(), &artwork_query.ArtworkPreviewListRequest{
Page: 1,
PageSize: -1,
ArtistUid: artistUid,
ArtworkUids: artworkUids,
})
if err != nil {
fmt.Println("画作列表查询失败", err.Error())
return 0, 0
}
artworkTotal = int64(artworkList.Count)
for _, v := range artworkList.Data {
artworkRulerTotal += int64(v.Ruler)
}