作者 郑周

1 系统消息,条件查询补充

@@ -122,6 +122,12 @@ func (repository *MessageSystemRepository) Find(ctx context.Context, conn transa @@ -122,6 +122,12 @@ func (repository *MessageSystemRepository) Find(ctx context.Context, conn transa
122 queryFunc := func() (interface{}, error) { 122 queryFunc := func() (interface{}, error) {
123 tx = tx.Model(&ms).Order("id desc") 123 tx = tx.Model(&ms).Order("id desc")
124 if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil { 124 if total, tx = transaction.PaginationAndCount(ctx, tx, queryOptions, &ms); tx.Error != nil {
  125 + if v, ok := queryOptions["companyId"]; ok {
  126 + tx.Where("company_id = ?", v)
  127 + }
  128 + if v, ok := queryOptions["recipientId"]; ok {
  129 + tx.Where("recipient_id = ?", v)
  130 + }
125 return dms, tx.Error 131 return dms, tx.Error
126 } 132 }
127 return dms, nil 133 return dms, nil