| public function getDatabase(Request $request) | 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; | |||||
| } | } | ||||
| } | } |