Sfoglia il codice sorgente

take 500 data

ifah
root 5 anni fa
parent
commit
cded8830fc

+ 2
- 4
app/Http/Controllers/CustomerService/CustomerController.php Vedi File

} }


function createWorkID($limit){ function createWorkID($limit){
$number = WorkOrder::select('id','wo')->orderBy('wo','DESC')->first();
$number = WorkOrder::select('id','wo')->orderBy('created_at','DESC')->first();
$numberOnly = str_replace('WO-','',$number->wo); $numberOnly = str_replace('WO-','',$number->wo);
$numberOnly++; $numberOnly++;
return $numberOnly; return $numberOnly;
$nested_data = array(); $nested_data = array();


if($type == 'null' && $building == 'null' && $dealer == 'null'){ 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(500)->get();
}else if($type != 'null' && $building == 'null' && $dealer == 'null'){ }else if($type != 'null' && $building == 'null' && $dealer == 'null'){
$form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get(); $form = Form::with('Subscriber','PackageDetail','WorkOrder')->where('type_service',$type)->orderBy('created_at', 'desc')->get();
}else if($type != 'null' && $building != 'null' && $dealer == 'null'){ }else if($type != 'null' && $building != 'null' && $dealer == 'null'){
$q->where('building_name', $building)->get(); $q->where('building_name', $building)->get();
}],'PackageDetail','WorkOrder')->where('type_service',$type)->where('company_id',$dealer)->orderBy('created_at', 'desc')->get(); }],'PackageDetail','WorkOrder')->where('type_service',$type)->where('company_id',$dealer)->orderBy('created_at', 'desc')->get();
} }
if(!empty($form)){ if(!empty($form)){
foreach ($form as $key => $f) { foreach ($form as $key => $f) {
if(empty($f->WorkOrder)){ if(empty($f->WorkOrder)){
if($f->type_application == 'R'){ if($f->type_application == 'R'){
do { do {
$work_order = 'WO-'.$this->createWorkID(4); $work_order = 'WO-'.$this->createWorkID(4);
} while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder); } while (WorkOrder::where("wo", "=", $work_order)->first() instanceof WorkOrder);


$wo = $work_order.'/'.$f->Subscriber->subscriber_id; $wo = $work_order.'/'.$f->Subscriber->subscriber_id;

Loading…
Annulla
Salva