From 9feea4302a952b9f2ed299227995b3976a5ce4d1 Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Fri, 7 Jan 2022 02:07:36 +0200 Subject: [PATCH] Support: Some fixes :3 --- Web/Models/Repositories/Tickets.php | 7 +++++-- Web/Presenters/templates/Support/AnswerTicket.xml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Web/Models/Repositories/Tickets.php b/Web/Models/Repositories/Tickets.php index 62ae4286..7f00e62b 100644 --- a/Web/Models/Repositories/Tickets.php +++ b/Web/Models/Repositories/Tickets.php @@ -36,9 +36,12 @@ class Tickets foreach($this->tickets->where(["user_id" => $userId, "deleted" => 0])->order("created DESC")->page($page, OPENVK_DEFAULT_PER_PAGE) as $ticket) yield new Ticket($ticket); } - function getTicketsCountByUserId(int $userId, int $type = 0): int + function getTicketsCountByUserId(int $userId, int $type = NULL): int { - return sizeof($this->tickets->where(["user_id" => $userId, "deleted" => 0, "type" => $type])); + if(is_null($type)) + return sizeof($this->tickets->where(["user_id" => $userId, "deleted" => 0])); + else + return sizeof($this->tickets->where(["user_id" => $userId, "deleted" => 0, "type" => $type])); } function getRequestById(int $requestId): ?Ticket diff --git a/Web/Presenters/templates/Support/AnswerTicket.xml b/Web/Presenters/templates/Support/AnswerTicket.xml index 7c4091be..c8fea4d7 100644 --- a/Web/Presenters/templates/Support/AnswerTicket.xml +++ b/Web/Presenters/templates/Support/AnswerTicket.xml @@ -20,7 +20,7 @@
-
+