ticket and comment count and badge and new notif

This commit is contained in:
Parsa Nazer
2025-02-05 01:36:21 +03:30
parent d4d06493fb
commit 8700fde8a4
4 changed files with 40 additions and 3 deletions
+10 -1
View File
@@ -1,5 +1,8 @@
from order.models import OrderModel
from product.models import DollorModel
from product.models import DollorModel, CommentModel
from ticket.models import Ticket
def admin_pending_count(request):
pending_count = OrderModel.objects.filter(status='ADMIN_PENDING').count()
return str(pending_count)
@@ -7,3 +10,9 @@ def admin_pending_count(request):
def dollor_price(request):
dollor_object, _ = DollorModel.objects.get_or_create(unique_filed='unique')
return str(dollor_object.price)[:2]
def comment_count(request):
return CommentModel.objects.all().count()
def new_ticket_count(request):
return Ticket.objects.filter(status__in=['open', 'in_progress']).count()