Browse Source

add condition if wo not empty

ifah
Siti Hajar Ibrahim 4 years ago
parent
commit
cbf27fbeba
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      app/Http/Controllers/Controller.php

+ 3
- 0
app/Http/Controllers/Controller.php View File

@@ -21,10 +21,13 @@ class Controller extends BaseController

foreach ($response->data as $key => $r) {
$work_order = WorkOrder::where('wo', $r->wo)->first();

if(!empty($work_order)){
$form_submitted = Form::where('_id', $work_order->_id)->first();

$form_submitted->customer_category = $r->category;
$form_submitted->save();
}
}

return 'data inserted ';

Loading…
Cancel
Save