fix: scope coupons by tenant
This commit is contained in:
@@ -160,9 +160,12 @@ func (s *user) RealName(ctx context.Context, userID int64, form *user_dto.RealNa
|
||||
}
|
||||
|
||||
// GetNotifications 获取通知
|
||||
func (s *user) GetNotifications(ctx context.Context, userID int64, typeArg string) ([]user_dto.Notification, error) {
|
||||
func (s *user) GetNotifications(ctx context.Context, tenantID, userID int64, typeArg string) ([]user_dto.Notification, error) {
|
||||
tbl, query := models.NotificationQuery.QueryContext(ctx)
|
||||
query = query.Where(tbl.UserID.Eq(userID))
|
||||
if tenantID > 0 {
|
||||
query = query.Where(tbl.TenantID.Eq(tenantID))
|
||||
}
|
||||
if typeArg != "" && typeArg != "all" {
|
||||
query = query.Where(tbl.Type.Eq(typeArg))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user