updated table structure for photobooth/sparkbooth settings. now there's a separate table for it. update all references and tests. also fixed the notification panel and the lightbox in the guest app.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventPhotoboothSetting;
|
||||
use App\Services\Photobooth\PhotoboothProvisioner;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -17,12 +17,20 @@ class DeactivateExpiredPhotoboothAccounts extends Command
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
Event::query()
|
||||
->where('photobooth_enabled', true)
|
||||
->whereNotNull('photobooth_expires_at')
|
||||
->where('photobooth_expires_at', '<=', now())
|
||||
->chunkById(50, function ($events) use (&$total, $provisioner) {
|
||||
foreach ($events as $event) {
|
||||
EventPhotoboothSetting::query()
|
||||
->where('enabled', true)
|
||||
->where('mode', 'ftp')
|
||||
->whereNotNull('expires_at')
|
||||
->where('expires_at', '<=', now())
|
||||
->with('event')
|
||||
->chunkById(50, function ($settings) use (&$total, $provisioner) {
|
||||
foreach ($settings as $setting) {
|
||||
$event = $setting->event;
|
||||
|
||||
if (! $event) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$provisioner->disable($event);
|
||||
$total++;
|
||||
|
||||
Reference in New Issue
Block a user