|
@@ -38,15 +38,13 @@ class Authority extends Model
|
|
|
public static function filterRecycle(Collection $authorities)
|
|
public static function filterRecycle(Collection $authorities)
|
|
|
{
|
|
{
|
|
|
$owners = Owner::query()->whereNotNull("deleted_at")->get();
|
|
$owners = Owner::query()->whereNotNull("deleted_at")->get();
|
|
|
- $owner_names = $owners->map(function($owner){
|
|
|
|
|
- if (mb_strpos($owner->name,"(停用)")){
|
|
|
|
|
- $name = mb_substr($owner->name,0,mb_stripos($owner->name,"(停用)"));
|
|
|
|
|
- return "(货主:{$name})";
|
|
|
|
|
- }
|
|
|
|
|
- return "(货主:{$owner->name})";
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $owner_keys = $owners->map(function($owner){
|
|
|
|
|
+ return '_'.$owner['id'];
|
|
|
})->toArray();
|
|
})->toArray();
|
|
|
- return $authorities->filter(function ($authority)use($owner_names){
|
|
|
|
|
- return !in_array($authority->alias_name,$owner_names);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return $authorities->filter(function ($authority)use($owner_keys){
|
|
|
|
|
+ return !in_array($authority->name,$owner_keys);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|