diff --git a/database/migrations/2024_09_10_indexes.php b/database/migrations/2024_09_10_indexes.php new file mode 100644 index 0000000..e316942 --- /dev/null +++ b/database/migrations/2024_09_10_indexes.php @@ -0,0 +1,38 @@ +index(['created_at']); + $table->index(['datetime']); + }); + + DB::statement('CREATE INDEX echomail_seenby_unsent ON echomail_seenby (address_id,echomail_id) WHERE sent_at IS NULL AND export_at IS NOT NULL;'); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('echomails', function (Blueprint $table) { + $table->dropIndex(['created_at']); + $table->dropIndex(['datetime']); + }); + + DB::statement('DROP INDEX echomail_seenby_unsent'); + } +}; diff --git a/resources/views/domain/list.blade.php b/resources/views/domain/list.blade.php index 35d3e1a..2516a67 100644 --- a/resources/views/domain/list.blade.php +++ b/resources/views/domain/list.blade.php @@ -39,7 +39,7 @@ use App\Models\{Address,Domain}; {{ $do->active ? 'Active' : 'Not Active' }} {{ $do->isManaged() ? 'YES' : 'NO' }} - @foreach (($x=$do->zones->pluck('addresses')->flatten())->where('role_id',Address::NODE_ZC)->sortBy('zone.zone_id') as $ao) + @foreach (($x=$do->zones->pluck('addresses')->flatten())->filter(fn($item)=>$item->node_id === 0)->where('role_id',Address::NODE_ZC)->sortBy('zone.zone_id') as $ao) {{ $ao->system->sysop }}, {{ $ao->system->name }}
@endforeach