| public function getDatabase(Request $request) | public function getDatabase(Request $request) | ||||
| { | { | ||||
| $subscriber = Subscriber::where('state','PERAK')->get(); | |||||
| foreach ($subscriber as $key => $cust) { | |||||
| # code... | |||||
| $form_submitted = Form::where('_id',$cust->_id)->first(); | |||||
| if(!empty($form_submitted)){ | |||||
| $form_submitted->project_type = "NFCP"; | |||||
| $form_submitted->save(); | |||||
| } | |||||
| $work_order = WorkOrder::where('_id',$cust->_id)->first(); | |||||
| if(!empty($work_order)){ | |||||
| $claim = DealerClaim::where('wo',$work_order->wo)->first(); | |||||
| if(!empty($claim)){ | |||||
| $claim->projectT = "NFCP"; | |||||
| $claim->save(); | |||||
| } | |||||
| } | |||||
| } | |||||
| $staff = Staff::where('api_token', '')->where('roles_access', 'Installer')->get(); | |||||
| return $staff; | |||||
| } | } | ||||
| } | } |