mirror of
https://github.com/danielbrendel/hortusfox-web.git
synced 2026-05-07 22:29:38 -05:00
Chat feature
This commit is contained in:
@@ -91,6 +91,25 @@ class UserModel extends \Asatru\Database\Model {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function updateLastSeenMsg($id)
|
||||
{
|
||||
try {
|
||||
$user = static::getAuthUser();
|
||||
if (!$user) {
|
||||
throw new \Exception('User not authenticated');
|
||||
}
|
||||
|
||||
static::raw('UPDATE `' . self::tableName() . '` SET last_seen_msg = ? WHERE id = ?', [$id, $user->get('id')]);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the associated table name of the migration
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user