update
This commit is contained in:
@@ -50,13 +50,13 @@ class AutocompleteController extends Controller {
|
||||
}
|
||||
|
||||
public function relationship() {
|
||||
$bloodType = DB::connection('oldlms')->table('tm_hubungan_keluarga')->get()->toArray();
|
||||
$relation = DB::connection('oldlms')->table('tm_hubungan_keluarga')->get()->toArray();
|
||||
|
||||
$data = [];
|
||||
|
||||
if ($bloodType){
|
||||
if ($relation){
|
||||
$temp = [];
|
||||
foreach($bloodType as $d){
|
||||
foreach($relation as $d){
|
||||
$temp['id'] = $d->nID;
|
||||
$temp['value'] = $d->sHubunganKeluarga;
|
||||
|
||||
@@ -66,5 +66,31 @@ class AutocompleteController extends Controller {
|
||||
}
|
||||
return Helper::responseJson($data);
|
||||
}
|
||||
|
||||
public function corporate(Request $request) {
|
||||
$search = $request->search;
|
||||
$corporate = DB::table('corporates')
|
||||
->where(function ($query) use ($search) {
|
||||
$query->where('name', 'like', "%$search%")
|
||||
->orWhere('code', 'like', "%$search%");
|
||||
})
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$data['company'] = [];
|
||||
|
||||
if ($corporate){
|
||||
$temp = [];
|
||||
foreach($corporate as $d){
|
||||
$temp['id'] = $d->id;
|
||||
$temp['name'] = $d->name;
|
||||
$temp['linking_rule'] = json_decode($d->linking_rules);
|
||||
|
||||
array_push($data['company'], $temp);
|
||||
}
|
||||
|
||||
}
|
||||
return Helper::responseJson($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user