Browse Source

get database

hajar
Siti Hajar Ibrahim 5 years ago
parent
commit
2fac812d0b
1 changed files with 9 additions and 18 deletions
  1. 9
    18
      app/Http/Controllers/Controller.php

+ 9
- 18
app/Http/Controllers/Controller.php View File

@@ -120,26 +120,17 @@ class Controller extends BaseController

public function getDatabase(Request $request)
{
// $subscriber = Subscriber::groupBy('city')->get();
$subscriber = Subscriber::groupBy('city')->get();

// $city = array();
$city = array();
// foreach ($subscriber as $key => $s) {
// # code...
// array_push($city, array(
// 'city' => $s->city
// ));
// }
foreach ($subscriber as $key => $s) {
# code...
array_push($city, array(
'city' => $s->city
));
}
// return $city;

$work_order = WorkOrder::where('wo', 'WO-15610')->first();

$subscriber = Subscriber::where('_id',$work_order->_id)->first();

$subscriber->unit_no = "8, LORONG 1";
$subscriber->save();

return $subscriber;
return $city;
}
}

Loading…
Cancel
Save