| @@ -69,7 +69,7 @@ class CustomerController extends Controller | |||
| $nested_data = array(); | |||
| if($type == 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->get(); | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->orderBy('created_at', 'desc')->take(2)->get(); | |||
| }else if($type != 'null' && $building == 'null' && $dealer == 'null'){ | |||
| $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); | |||
| }else if($type != 'null' && $building != 'null' && $dealer == 'null'){ | |||
| @@ -102,7 +102,6 @@ class CustomerController extends Controller | |||
| $q->where('building_name', $building)->get(); | |||
| }],'PackageDetail','WorkOrder')->where('type_service',$type)->where('company_id',$dealer)->orderBy('created_at', 'desc')->get(); | |||
| } | |||
| if(!empty($form)){ | |||
| foreach ($form as $key => $f) { | |||
| if(empty($f->WorkOrder)){ | |||
| @@ -1392,4 +1391,4 @@ class CustomerController extends Controller | |||
| // Send JSON to the client. | |||
| echo $json; | |||
| } | |||
| } | |||
| } | |||