by Robin at 20240411
This commit is contained in:
parent
776e50f148
commit
acfe24623f
|
@ -16,6 +16,7 @@ const (
|
|||
AccountPunishment_BlockFromCreatingMoment = 0 // 禁止发贴
|
||||
AccountPunishment_BlockFromCreatingFreeZoneMoment = 1 // 禁止发免费空间贴
|
||||
AccountPunishment_BlockFromCreatingPaidZoneMoment = 2 // 禁止发付费空间贴
|
||||
AccountPunishment_BlockFromCreatingZoneMoment = 3 // 禁止发空间贴
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -4082,16 +4082,18 @@ func (m *Mongo) GetZoneMomentListByZid(ctx *gin.Context, req *zonemomentproto.Op
|
|||
}
|
||||
|
||||
orClause := make([]qmgo.M, 0)
|
||||
orClause = append(orClause, qmgo.M{
|
||||
"is_headed": consts.IsHeaded_Yes,
|
||||
})
|
||||
if len(ctClause) != 0 {
|
||||
orClause = append(orClause, qmgo.M{
|
||||
"is_headed": consts.IsHeaded_Yes,
|
||||
})
|
||||
orClause = append(orClause, qmgo.M{
|
||||
"ct": ctClause,
|
||||
})
|
||||
}
|
||||
if len(orClause) != 0 {
|
||||
query["$or"] = orClause
|
||||
}
|
||||
|
||||
query["$or"] = orClause
|
||||
err := col.Find(ctx, query).Sort("-is_headed", "-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
err = nil
|
||||
|
|
|
@ -560,6 +560,7 @@ func (s *Service) ApiCreateZoneMomentBusinessValidate(ctx *gin.Context, req *zon
|
|||
QueryAccount(_DefaultAccount.OpListByMid).
|
||||
EnsureAccountExist().
|
||||
EnsureIsThisRole(consts.Streamer).
|
||||
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, consts.AccountPunishment_BlockFromCreatingZoneMoment, _DefaultAccountPunishment.OpListByMidAndType).
|
||||
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, pType, _DefaultAccountPunishment.OpListByMidAndType).
|
||||
EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(_DefaultZoneMoment.OpCountByMidAndCType, req.GetBaseRequest().Mid, util.DerefInt64(req.CType)).
|
||||
Validate().
|
||||
|
|
Loading…
Reference in New Issue