feat(projects-bulk): update_days handler with bitmask OR/AND-NOT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Дмитрий
2026-05-12 14:52:23 +03:00
parent 8220a85a5d
commit c025ec4b69
3 changed files with 32 additions and 7 deletions
+8 -1
View File
@@ -101,7 +101,14 @@ class ProjectService
private function bulkUpdateDays($query, array $payload): array
{
return ['updated' => 0, 'skipped' => [], 'warnings' => []];
$add = (int) ($payload['add'] ?? 0);
$remove = (int) ($payload['remove'] ?? 0);
$updated = $query->update([
'delivery_days_mask' => \DB::raw("(delivery_days_mask | {$add}) & ~{$remove} & 127"),
]);
return ['updated' => $updated, 'skipped' => [], 'warnings' => []];
}
private function bulkUpdateLimit($query, array $payload): array