Added echomail search and display
This commit is contained in:
@@ -9,7 +9,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Models\{Address,Domain,Setup};
|
||||
use App\Models\{Address,Domain,Echomail,Setup};
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -86,7 +86,7 @@ class HomeController extends Controller
|
||||
|
||||
list($zone_id,$host_id,$node_id,$point_id,$domain) = sscanf($request->query('term'),'%d:%d/%d.%d@%s');
|
||||
|
||||
# Look for Opportunities
|
||||
# Look for Systems
|
||||
foreach (Address::select(['systems.name',DB::raw('systems.id AS system_id'),'zones.zone_id','region_id','host_id','node_id','point_id'])
|
||||
->join('zones',['zones.id'=>'addresses.zone_id'])
|
||||
->rightjoin('systems',['systems.id'=>'addresses.system_id'])
|
||||
@@ -113,6 +113,14 @@ class HomeController extends Controller
|
||||
$result->push(['id'=>$o->system_id,'name'=>$o->name.($ftn ? ' '.$ftn : ''),'value'=>url('ftn/system/addedit',[$o->system_id]),'category'=>'Systems']);
|
||||
}
|
||||
|
||||
# Look for Messages
|
||||
foreach (Echomail::select(['id','fftn_id','from'])
|
||||
->where('msgid','like','%'.$request->query('term').'%')
|
||||
->get() as $o)
|
||||
{
|
||||
$result->push(['id'=>$o->id,'name'=>sprintf('%s (%s)',$o->from,$o->fftn->ftn3d),'value'=>url('echomail/view',[$o->id]),'category'=>'Echomail']);
|
||||
}
|
||||
|
||||
return $result->unique(['id'])->take(10)->values();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user