Fixed some field job problem where field operator could still see archived contracts
This commit is contained in:
@@ -69,6 +69,8 @@ public function executeSetting(ArchiveSetting $setting, ?array $context = null,
|
||||
$entities = $flat;
|
||||
}
|
||||
|
||||
// dd($entities);
|
||||
|
||||
foreach ($entities as $entityDef) {
|
||||
$rawTable = $entityDef['table'] ?? null;
|
||||
if (! $rawTable) {
|
||||
@@ -97,7 +99,7 @@ public function executeSetting(ArchiveSetting $setting, ?array $context = null,
|
||||
// Process in batches to avoid locking large tables
|
||||
while (true) {
|
||||
$query = DB::table($table)->whereNull('deleted_at');
|
||||
if (Schema::hasColumn($table, 'active')) {
|
||||
if (Schema::hasColumn($table, 'active') && ! $reactivate) {
|
||||
$query->where('active', 1);
|
||||
}
|
||||
// Apply context filters or chain derived filters
|
||||
|
||||
Reference in New Issue
Block a user