mirror of
https://github.com/openvk/openvk
synced 2025-07-07 08:19:49 +03:00
fixes
This commit is contained in:
parent
e7dfcdfb67
commit
cb8602ef02
3 changed files with 11 additions and 13 deletions
|
@ -108,7 +108,7 @@ class TicketComment extends RowModel
|
|||
return false; # Кооостыыыль!!!
|
||||
}
|
||||
|
||||
function getMark(): int
|
||||
function getMark(): ?int
|
||||
{
|
||||
return $this->getRecord()->mark;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class TicketComments
|
|||
// return $this->toTicket($this->tickets->get($id));
|
||||
// }
|
||||
|
||||
function get(int $id): TicketComment
|
||||
function get(int $id): ?TicketComment
|
||||
{
|
||||
$comment = $this->comments->where(['id' => $id])->fetch();
|
||||
if (!is_null($comment))
|
||||
|
|
|
@ -233,17 +233,15 @@ final class SupportPresenter extends OpenVKPresenter
|
|||
|
||||
$comment = $this->comments->get($id);
|
||||
|
||||
if($this->user->id === $this->tickets->get($comment->getTicketId())->getUser()->getId()) {
|
||||
$comments->setMark($mark);
|
||||
$comments->save();
|
||||
|
||||
if($mark === 1 || $mark === 2) {
|
||||
exit(header("HTTP/1.1 200 OK"));
|
||||
} else {
|
||||
exit(header("HTTP/1.1 400 Bad Request"));
|
||||
}
|
||||
} else {
|
||||
if($this->user->id !== $this->tickets->get($comment->getTicketId())->getUser()->getId())
|
||||
exit(header("HTTP/1.1 403 Forbidden"));
|
||||
}
|
||||
|
||||
if($mark === 1 || $mark === 2)
|
||||
header("HTTP/1.1 200 OK");
|
||||
else
|
||||
exit(header("HTTP/1.1 400 Bad Request"));
|
||||
|
||||
$comment->setMark($mark);
|
||||
$comment->save();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue