mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
v3.0.7a
This commit is contained in:
23
app/User.php
23
app/User.php
@@ -236,4 +236,27 @@ class User extends Authenticatable
|
||||
}
|
||||
return $nbClasse;
|
||||
}
|
||||
|
||||
public function seenMessage($id)
|
||||
{
|
||||
$this_msg = Message::find($id);
|
||||
|
||||
if(isset($this_msg->data['as_seen']))
|
||||
{
|
||||
$as_seen = explode("-",$this_msg->data['as_seen']);
|
||||
if (array_search(strval($this->id),$as_seen) === false) {
|
||||
array_push($as_seen,$this->id);
|
||||
}
|
||||
$as_seen = array_filter($as_seen);
|
||||
$as_seen_str = implode('-',$as_seen);
|
||||
$data = [
|
||||
'as_seen' => $as_seen_str,
|
||||
'parameter' => $this_msg->data['parameter']
|
||||
];
|
||||
|
||||
$this_msg->data = $data;
|
||||
|
||||
$this_msg->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user