add api
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user