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