mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
parent
25d0fde3c3
commit
478f8f9368
3 changed files with 11 additions and 2 deletions
|
@ -36,6 +36,11 @@ class Tickets
|
|||
foreach($this->tickets->where(['user_id' => $user_id, 'deleted' => 0]) as $ticket) yield new Ticket($ticket);
|
||||
}
|
||||
|
||||
function getTicketsCountByuId(int $user_id, int $type = 0): int
|
||||
{
|
||||
return sizeof($this->tickets->where(['user_id' => $user_id, 'deleted' => 0, 'type' => $type]));
|
||||
}
|
||||
|
||||
function getRequestById(int $req_id): ?Ticket
|
||||
{
|
||||
$requests = $this->tickets->where(['id' => $req_id])->fetch();
|
||||
|
|
|
@ -7,7 +7,7 @@ use Chandler\Security\Authenticator;
|
|||
use Latte\Engine as TemplatingEngine;
|
||||
use openvk\Web\Models\Entities\IP;
|
||||
use openvk\Web\Themes\Themepacks;
|
||||
use openvk\Web\Models\Repositories\{IPs, Users, APITokens};
|
||||
use openvk\Web\Models\Repositories\{IPs, Users, APITokens, Tickets};
|
||||
|
||||
abstract class OpenVKPresenter extends SimplePresenter
|
||||
{
|
||||
|
@ -207,6 +207,7 @@ abstract class OpenVKPresenter extends SimplePresenter
|
|||
$this->user->identity->save();
|
||||
}
|
||||
|
||||
$this->template->ticketAnsweredCount = (new Tickets)->getTicketsCountByuId($this->user->id, 1);
|
||||
}
|
||||
|
||||
setlocale(LC_TIME, ...(explode(";", tr("__locale"))));
|
||||
|
|
|
@ -98,7 +98,10 @@
|
|||
<a href="/search">{_"header_search"}</a>
|
||||
</div>
|
||||
<div class="link">
|
||||
<a href="/support">{_"header_help"}</a>
|
||||
<a href="/support">
|
||||
{_"header_help"}
|
||||
<b n:if="$ticketAnsweredCount > 0">({$ticketAnsweredCount})</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="link">
|
||||
<a href="/logout">{_"header_log_out"}</a>
|
||||
|
|
Loading…
Reference in a new issue