Update Models\PM\Model.

Delete updateFromPTopics() method.
This commit is contained in:
Visman 2021-04-04 13:32:46 +07:00
parent 9a6d74ce5e
commit bb1f76ce51

View file

@ -457,36 +457,6 @@ class Model extends ParentModel
return $this->loadByIds(Cnst::PTOPIC, \array_keys($ids));
}
/**
* Обновляет данные в разных таблицах базы ????
*/
public function updateFromPTopics(bool $add, PTopic ...$topics): void
{
$users = [];
foreach ($topics as $topic) {
if (! $topic->zpUser->isGuest) {
$users[$topic->zpUser->id] = $topic->zpUser;
}
if (! $topic->ztUser->isGuest) {
$users[$topic->ztUser->id] = $topic->ztUser;
}
}
foreach ($users as $user) {
list($idsNew, $idsCurrent, $idsArchive, $new, $current, $archive) = $this->infoForUser($user);
$user->u_pm_num_new = $new;
$user->u_pm_num_all = $current;
if ($user !== $this->c->user) {
//$user->u_pm_flash = ????
}
$this->c->users->update($user);
}
}
/**
* Перечитывает данные приватных сообщений пользователя
*/