修复字段取值错误的问题
This commit is contained in:
parent
5ba05220d3
commit
0af56855e0
@ -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)
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ func (a ArtistInfoArtworkLogic) ArtworkStatic(request *artistInfoArtwork.ArtistA
|
||||
//统计画家素有画作的总数和总平尺数
|
||||
artworkTotal, rulerTotal = dao.CountAllArtworkTotal(v.ArtistUid)
|
||||
//统计审核通过的画作总数和平尺总数
|
||||
passedArtworkTotal, passedRulerTotal = dao.CountArtworkTotalWhichAuditPassed(v.ArtistUid)
|
||||
passedRulerTotal, passedArtworkTotal = dao.CountArtworkTotalWhichAuditPassed(v.ArtistUid)
|
||||
//补充画家信息
|
||||
for _, artistData := range artistList.Data {
|
||||
if artistData.Uid == v.ArtistUid {
|
||||
|
Loading…
Reference in New Issue
Block a user