This commit is contained in:
hafifierahman
2021-09-12 10:20:16 +08:00
parent 0ea8b2912e
commit a267f0fbd7
3 changed files with 186 additions and 95 deletions
@@ -707,4 +707,23 @@ class CustomerController extends Controller
return response()->json($blacklist);
}
public function showCustomerByEachCawangan($ic)
{
$cawangan_all = Cawangan::on('mysql7')->get();
$custcawangan = array();
foreach($cawangan_all as $index=>$cawangan)
{
$customer = Gadai::on($cawangan['mysql'])
->select('kodcaw')
->where('nokp', '=', $ic)
->first();
if($customer)
array_push($custcawangan, $customer);
}
return response()->json($custcawangan);
}
}