mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
user softdelete
This commit is contained in:
1 parent
d3f6d8a643
commit
4d4cb643ec
10 files changed
+53
-18
No files matched your search
@@ -35,18 +35,16 @@ class MasterTask extends Model
|
||||
// vracia userov, ktori su priradeni k subtasku ale nepatria do teamu
|
||||
public function getUsersOutsideTeamAttribute()
|
||||
{
|
||||
|
||||
$users = $this->subtasks->pluck('user')->unique();
|
||||
|
||||
//remove null values - priprady, kedy bol user zmazany
|
||||
$users = $users->filter();
|
||||
|
||||
// ak nie je uvedeny ziaden team, tak sa vratia vsetci useri
|
||||
if (!$this->team){
|
||||
return $users;
|
||||
}
|
||||
|
||||
return $users->filter(function ($user) {
|
||||
return !in_array($this->team->id, isset($user->teams) ? $user->teams->pluck('id')->unique()->toArray() : []);
|
||||
return !in_array($this->team->id, $user->teams->pluck('id')->unique()->toArray());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user