From 7073fece940c4be7c0784d7bbde71bf246e2d1ad Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 6 Jul 2023 15:50:46 +1000 Subject: [PATCH] Fix showing packet dump on view packet, change Address::active() to not take into account zone/domain --- app/Models/Address.php | 9 ++++++++- resources/views/pkt.blade.php | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Models/Address.php b/app/Models/Address.php index 4b77897..b844a61 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -60,7 +60,7 @@ class Address extends Model /* SCOPES */ - public function scopeActive($query) + public function scopeActiveFTN($query) { return $query->select($this->getTable().'.*') ->join('zones',['zones.id'=>'addresses.zone_id']) @@ -378,6 +378,7 @@ class Address extends Model * @param string $address * @param bool $create * @param System|null $so + * @param bool $trashed * @return Address|null * @throws \Exception */ @@ -388,6 +389,9 @@ class Address extends Model // Are we looking for a region address if (($ftn['f'] === 0) && $ftn['p'] === 0) { $o = (new self) + ->select('addresses.*') + ->join('zones',['zones.id'=>'addresses.zone_id']) + ->join('domains',['domains.id'=>'zones.domain_id']) ->when($trashed,function($query) { $query->trashed(); },function($query) { @@ -416,6 +420,9 @@ class Address extends Model } $o = (new self) + ->select('addresses.*') + ->join('zones',['zones.id'=>'addresses.zone_id']) + ->join('domains',['domains.id'=>'zones.domain_id']) ->when($trashed,function($query) { $query->trashed(); },function($query) { diff --git a/resources/views/pkt.blade.php b/resources/views/pkt.blade.php index 8094a17..726e900 100644 --- a/resources/views/pkt.blade.php +++ b/resources/views/pkt.blade.php @@ -60,7 +60,7 @@ @foreach($results as $item) @foreach ($item as $file => $result) -
+

Packet {{ $file }} (type {{ $result->type }}) is from {{ $result->fftn }} to {{ $result->tftn }}, dated {{ $result->date }}.

This packet has {{ $result->messages->count() }} messages and {{ $result->password ? 'DOES' : 'does NOT' }} have a password.

@@ -152,13 +152,14 @@
+ @endforeach
- -
+
 {{ $hexdump }}
@@ -167,7 +168,6 @@
 											
- @endforeach