Compare commits

..

No commits in common. "bfbf512b0d48f8f7f347c0ea83282f1f8419c7cf" and "d6a2c70146b4e184149a646a69830dd125495426" have entirely different histories.

4 changed files with 22 additions and 28 deletions

View File

@ -44,15 +44,16 @@ class SearchController extends Controller
// Look for User by their Supplier ID with some suppliers // Look for User by their Supplier ID with some suppliers
if (is_numeric($request->input('term'))) if (is_numeric($request->input('term')))
foreach (Account::select(['user_id','suppliers.name AS supplier_name','account_supplier.supplier_ref AS pivot_id']) foreach (User::select(['users.*','suppliers.name AS supplier_name','supplier_user.id AS pivot_id'])
->join('account_supplier',['account_supplier.account_id'=>'accounts.id']) ->join('supplier_user',['supplier_user.user_id'=>'users.id'])
->join('suppliers',['suppliers.id'=>'account_supplier.supplier_id']) ->join('suppliers',['suppliers.id'=>'supplier_user.supplier_id'])
->whereIN('accounts.id',$account_ids) ->whereIN('user_id',$user_ids)
->where('account_supplier.supplier_ref','like','%'.$request->input('term').'%') ->where('supplier_user.id','like','%'.$request->input('term').'%')
->orderBy('company') ->orderBy('lastname')
->orderBy('firstname')
->limit(10)->get() as $o) ->limit(10)->get() as $o)
{ {
$result->push(['name'=>sprintf('%s (%s:%s)',$o->company,$o->supplier_name,$o->supplier_ref),'value'=>'/u/home/'.$o->user_id,'category'=>'Suppliers']); $result->push(['name'=>sprintf('%s (%s:%s)',$o->name,$o->supplier_name,$o->pivot_id),'value'=>'/u/home/'.$o->id,'category'=>'Suppliers']);
} }
// Look for Account // Look for Account

View File

@ -18,7 +18,6 @@
<th>Address</th> <th>Address</th>
<td>{{ $o->service_address }}</td> <td>{{ $o->service_address }}</td>
</tr> </tr>
@if($o->pppoe)
<tr> <tr>
<th>Service Number</th> <th>Service Number</th>
<td>{{ $o->service_number }}</td> <td>{{ $o->service_number }}</td>
@ -27,12 +26,6 @@
<th>Service Username</th> <th>Service Username</th>
<td>{{ $o->service_username }}</td> <td>{{ $o->service_username }}</td>
</tr> </tr>
@else
<tr>
<th>Service Type</th>
<td>Layer 2</td>
</tr>
@endif
<tr> <tr>
<th>Service Password</th> <th>Service Password</th>
<td>{{ $o->service_password }}</td> <td>{{ $o->service_password }}</td>

View File

@ -19,7 +19,7 @@
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-12 col-sm-9 col-md-6 col-xl-5"> <div class="col-12 col-sm-9 col-md-6 col-xl-5">
<x-leenooks::form.date id="invoice_next_at" name="invoice_next_at" icon="fa-calendar" label="Billing Start Date" :value="($o->getRawOriginal('invoice_next_at') ?: $o->getRawOriginal('connect_at'))"/> <x-leenooks::form.date id="invoice_next_at" name="invoice_next_at" icon="fa-calendar" label="Billing Start Date" :value="($o->invoice_next_at ?: $o->connect_at)?->format('Y-m-d')"/>
</div> </div>
<!-- Price --> <!-- Price -->