Show packet contents for nodes

This commit is contained in:
2023-07-16 00:41:36 +10:00
parent a3302b4012
commit a8f76aec31
5 changed files with 142 additions and 4 deletions

View File

@@ -31,6 +31,34 @@ class HomeController extends Controller
->with('o',$o);
}
public function packet_contents(string $packet)
{
$nm = Netmail::select('netmails.*')
->distinct()
->leftJoin('netmail_path',['netmail_path.netmail_id'=>'netmails.id'])
->where(function($query) use ($packet) {
return $query
->where('sent_pkt',$packet)
->orWhere('netmail_path.recv_pkt',$packet);
})
->get();
$em = Echomail::select('echomails.*')
->distinct()
->leftJoin('echomail_seenby',['echomail_seenby.echomail_id'=>'echomails.id'])
->leftJoin('echomail_path',['echomail_path.echomail_id'=>'echomails.id'])
->where(function($query) use ($packet) {
return $query
->where('sent_pkt',$packet)
->orWhere('recv_pkt',$packet);
})
->get();
return view('packet')
->with('nm',$nm)
->with('em',$em);
}
/**
* Render a view that summarises the users permissions
*/