修复BUG(个人信息&通知公告): 个人未读通知公告数量错误

pull/12/head
李强 2021-03-30 01:45:57 +08:00
parent fbc9203ef8
commit 85b1f74895
1 changed files with 2 additions and 2 deletions

View File

@ -226,8 +226,8 @@ class UserProfileSerializer(CustomModelSerializer):
return False
def get_unread_msg_count(self, obj: UserProfile):
return MessagePush.objects.filter(status='2').exclude(user=obj,
messagepushuser_message_push__is_read=True).count()
return MessagePush.objects.filter(status='2').exclude(messagepushuser_message_push__is_read=True,
messagepushuser_message_push__user=obj).count()
class Meta:
model = UserProfile