| @@ -92,9 +92,9 @@ class FormController extends BaseController | |||
| public function get_data_form(Request $request){ | |||
| $dateS = Carbon::createFromFormat('Y-m-d', $request->startDate); | |||
| $dateS = Carbon::createFromFormat('Y-m-d', '2020-01-01'); | |||
| $start = $dateS->copy()->startOfDay(); | |||
| $dateE = Carbon::createFromFormat('Y-m-d', $request->endDate); | |||
| $dateE = Carbon::createFromFormat('Y-m-d', '2020-07-16'); | |||
| $end = $dateE->copy()->endOfDay(); | |||
| $result = array(); | |||
| @@ -141,65 +141,53 @@ class FormController extends BaseController | |||
| $address = $f->Subscriber->postcode. ' , '.$f->Subscriber->city. ' , '.$f->Subscriber->state; | |||
| } | |||
| $woD = '-'; $woId = 'none'; $natureWork = ''; $doId = ''; $woRate=""; $installerId=""; | |||
| $woD = '-'; $woId = 'none'; $natureWork = ''; $doId = ''; $woRate=""; $installer_name=""; | |||
| if(!empty($f->WorkOrder)){ | |||
| $woId = $f->WorkOrder->wo; | |||
| $natureWork = $f->WorkOrder->nature_work; | |||
| $doId = $f->WorkOrder->docket_id; | |||
| $installer = StaffDetail::where('_id',$f->WorkOrder->installer_id)->get(); | |||
| foreach($installer as $installer) { | |||
| $installer_name = $installer->name; | |||
| } | |||
| if(!empty($f->WorkOrder->Docket)){ | |||
| $woD = $f->WorkOrder->Docket->end_job; | |||
| $woRate = $f->WorkOrder->Docket->Rating1; | |||
| // $installerId = $f->WordOrder->Docket->installer_id; | |||
| // array_push($result,array( | |||
| // 'type_application' => $f->type_application, | |||
| // "type_service" => $f->type_service, | |||
| // "customer_name"=> $name, | |||
| // "contact_no"=> $contact_no, | |||
| // "unit_no"=>$f->Subscriber->unit_no, | |||
| // "building"=>$building, | |||
| // "street"=>$address, | |||
| // "submitted_date" => $f->created_at->toDateTimeString(), | |||
| // "package_contract" => $f->PackageDetail->contract, | |||
| // "package_name" => $f->PackageDetail->name, | |||
| // 'dealer' => $labelD, | |||
| // 'wo' => $woId, | |||
| // 'activated_date' => $woD, | |||
| // )); | |||
| $woRate = $f->WorkOrder->Docket->Rating1; | |||
| } | |||
| } | |||
| // array_push($result,array( | |||
| // 'type_application' => $f->type_application, | |||
| // "type_service" => $f->type_service, | |||
| // "customer_name"=> $name, | |||
| // "contact_no"=> $contact_no, | |||
| // "unit_no"=>$f->Subscriber->unit_no, | |||
| // "building"=>$building, | |||
| // "street"=>$address, | |||
| // "submitted_date" => $f->created_at->toDateTimeString(), | |||
| // "package_contract" => $f->PackageDetail->contract, | |||
| // "package_name" => $f->PackageDetail->name, | |||
| // 'dealer' => $labelD, | |||
| // 'wo' => $woId, | |||
| // 'activated_date' => $woD, | |||
| // )); | |||
| array_push($result,array( | |||
| // 'Installer' => $installerId, | |||
| 'Dealer Name' => $labelD, | |||
| "Customer Name"=> $name, | |||
| "Contact Number"=> $contact_no, | |||
| 'Completion Date' => $woD, | |||
| 'Type Application' => $f->type_application, | |||
| "Form Type" => $f->type_service, | |||
| "Package"=> $f->PackageDetail->contract, | |||
| "WO No" => $woId, | |||
| "DO No" => $doId, | |||
| "Service Type" => $f->PackageDetail->name, | |||
| "Building"=>$building, | |||
| "Rating" => $woRate, | |||
| // "Claim Amount" => $amount_claim, | |||
| )); | |||
| 'type_application' => $f->type_application, | |||
| "type_service" => $f->type_service, | |||
| "customer_name"=> $name, | |||
| "contact_no"=> $contact_no, | |||
| "unit_no"=>$f->Subscriber->unit_no, | |||
| "building"=>$building, | |||
| "street"=>$address, | |||
| "submitted_date" => $f->created_at->toDateTimeString(), | |||
| "package_contract" => $f->PackageDetail->contract, | |||
| "package_name" => $f->PackageDetail->name, | |||
| 'dealer' => $labelD, | |||
| 'wo' => $woId, | |||
| 'activated_date' => $woD, | |||
| 'installer_name' => $installer_name, | |||
| )); | |||
| // array_push($result,array( | |||
| // // 'Installer' => $installerId, | |||
| // 'Dealer Name' => $labelD, | |||
| // "Customer Name"=> $name, | |||
| // "Contact Number"=> $contact_no, | |||
| // 'Completion Date' => $woD, | |||
| // 'Type Application' => $f->type_application, | |||
| // "Form Type" => $f->type_service, | |||
| // "Package"=> $f->PackageDetail->contract, | |||
| // "WO No" => $woId, | |||
| // "DO No" => $doId, | |||
| // "Service Type" => $f->PackageDetail->name, | |||
| // "Building"=>$building, | |||
| // "Rating" => $woRate, | |||
| // // "Claim Amount" => $amount_claim, | |||
| // )); | |||
| } | |||
| } | |||