diff --git a/app/logic/user/trend.go b/app/logic/user/trend.go index adf7773..c8452d0 100644 --- a/app/logic/user/trend.go +++ b/app/logic/user/trend.go @@ -3,6 +3,7 @@ package user import ( "live/app/lib" "live/app/lib/recook" + "live/app/model/momentscopy" "live/app/model/short" "live/app/model/topic" "live/app/model/user" @@ -87,10 +88,25 @@ func (t *Trend) GetList(loginUserId, userId uint, page lib.Page) *recook.TrendLi } //根据需求,返回视频的状态,风险或安全,审核中或审核失败通过 for i, k := range list.List { - var a short.Short - (&short.Short{}).GetDb().Where("id=?", k.OriginID).First(&a) - list.List[i].Compliance = a.Compliance - list.List[i].PassStatus = a.Pass + if k.Short.MediaUrl != "" { + var a short.Short + (&short.Short{}).GetDb().Where("id=?", k.OriginID).First(&a) + list.List[i].Compliance = a.Compliance + list.List[i].PassStatus = a.Pass + } + if len(k.ImgList) > 1 { + var gm momentscopy.MomentsCopy + (&momentscopy.MomentsCopy{}).GetDb().Where("id=?", k.OriginID).First(&gm) + list.List[i].Compliance = gm.Compliance + if gm.Reviewing == 0 { + list.List[i].PassStatus = 2 + } else if gm.Reviewing == 1 { + list.List[i].PassStatus = 0 + } else if gm.Reviewing == 2 { + list.List[i].PassStatus = 1 + } + } + } return list diff --git a/app/model/momentscopy/momentscopy.go b/app/model/momentscopy/momentscopy.go new file mode 100644 index 0000000..e6e017e --- /dev/null +++ b/app/model/momentscopy/momentscopy.go @@ -0,0 +1,22 @@ +package momentscopy + +import ( + "github.com/golangkit/formatime" + "live/app/lib/db" +) + +type MomentsCopy struct { + db.BaseModel + ID uint `gorm:"column:id;primary_key" json:"id"` + GoodsID uint `gorm:"column:goods_id" json:"goodsId"` + Text string `gorm:"column:text" json:"text"` + UserID uint `gorm:"column:user_id" json:"userId"` + HeadImgURL string `gorm:"column:head_img_url" json:"headImgUrl"` + Nickname string `gorm:"column:nickname" json:"nickname"` + Reviewing uint `gorm:"column:reviewing" json:"reviewing"` // 1 审核中, 0 审核通过, 2 拒绝 + CreatedAt formatime.Second `gorm:"column:created_at" json:"createdAt"` + ReasonID uint `gorm:"column:reason_id" json:"reasonId"` + ReasonNote string `gorm:"column:reason_note" json:"reasonNote"` + ManagerID int `gorm:"column:manager_id" json:"managerId"` // 审核人id(系统操作员) + Compliance int `gorm:"column:compliance" json:"compliance"` //合规 +}