Improve Get /insurances/networks
This commit is contained in:
parent
c3e69f71fc
commit
1436dbda22
|
@ -42,12 +42,22 @@ class InsuranceController extends Controller
|
||||||
* name="country_id",
|
* name="country_id",
|
||||||
* description="ID du pays",
|
* description="ID du pays",
|
||||||
* in="query",
|
* in="query",
|
||||||
* required=true,
|
* required=false,
|
||||||
* @OA\Schema(
|
* @OA\Schema(
|
||||||
* type="integer",
|
* type="integer",
|
||||||
* default=78
|
* default=78
|
||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
|
* @OA\Parameter(
|
||||||
|
* parameter="user_id",
|
||||||
|
* name="user_id",
|
||||||
|
* description="ID de l'utilisateur",
|
||||||
|
* in="query",
|
||||||
|
* required=true,
|
||||||
|
* @OA\Schema(
|
||||||
|
* type="integer",
|
||||||
|
* )
|
||||||
|
* ),
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
* response=200,
|
* response=200,
|
||||||
* description="OK",
|
* description="OK",
|
||||||
|
@ -66,9 +76,16 @@ class InsuranceController extends Controller
|
||||||
public function getInsurancesNetworks(Request $request)
|
public function getInsurancesNetworks(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'country_id' => 'nullable|integer|exists:countries,id'
|
'country_id' => 'nullable|integer|exists:countries,id',
|
||||||
|
'user_id' => 'nullable|integer|exists:users,id'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$user_id = $request->input('user_id');
|
||||||
|
if (!empty($user_id)) {
|
||||||
|
$insurances = DB::select("SELECT n.id , n.name FROM networks n JOIN configWallet cw ON cw.id_network = n.id JOIN nh_networks_configs nhc
|
||||||
|
ON nhc.network_id = n.id JOIN nh_insurances nhi ON nhi.network_id = n.id WHERE nhi.user_id = :user_id AND cw.type = 'ilink_sante' AND n.status = 1", ['user_id' => $user_id]);
|
||||||
|
|
||||||
|
} else {
|
||||||
$country = CountriesCurrency::findOrFail($request->input('country_id'));
|
$country = CountriesCurrency::findOrFail($request->input('country_id'));
|
||||||
|
|
||||||
$insurances = DB::select("SELECT n.id , n.name , nhc.age_limit_of_insured_and_spouse, nhc.age_limit_of_child_beneficiary, nhc.max_number_of_beneficiaries, nhc.id as nhc_id
|
$insurances = DB::select("SELECT n.id , n.name , nhc.age_limit_of_insured_and_spouse, nhc.age_limit_of_child_beneficiary, nhc.max_number_of_beneficiaries, nhc.id as nhc_id
|
||||||
|
@ -85,7 +102,7 @@ class InsuranceController extends Controller
|
||||||
$insurance->months_prices = $months_prices;
|
$insurance->months_prices = $months_prices;
|
||||||
unset($insurance->nhc_id);
|
unset($insurance->nhc_id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $this->successResponse($insurances);
|
return $this->successResponse($insurances);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,13 @@
|
||||||
|
|
||||||
<div class=WordSection1>
|
<div class=WordSection1>
|
||||||
|
|
||||||
<span style='font-size:11.0pt;font-family:"Tahoma",sans-serif;color:black'>iLink World Corporation</span>
|
<span style='font-size:11.0pt;font-family:"Tahoma",sans-serif;color:black'>{{$hyper->network}}</span>
|
||||||
|
|
||||||
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Tahoma",sans-serif;
|
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Tahoma",sans-serif;
|
||||||
color:black;margin-left: 45px;'>-------------------</span></p>
|
color:black;margin-left: 45px;'>-------------------</span></p>
|
||||||
|
|
||||||
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Tahoma",sans-serif;
|
{{-- <p class=MsoNormal><span style='font-size:11.0pt;font-family:"Tahoma",sans-serif;--}}
|
||||||
color:black'>Le numérique au service de l'inclusion financière</span></p>
|
{{--color:black'>Le numérique au service de l'inclusion financière</span></p>--}}
|
||||||
|
|
||||||
<p class=MsoNormal align=center style='text-align:center ; margin-top: 150px'>
|
<p class=MsoNormal align=center style='text-align:center ; margin-top: 150px'>
|
||||||
<b><u><span style='font-size:16.0pt;font-family:"Garamond",serif;color:black'>
|
<b><u><span style='font-size:16.0pt;font-family:"Garamond",serif;color:black'>
|
||||||
|
@ -203,7 +203,7 @@ color:black'>Le numérique au service de l'inclusion financière</span></p>
|
||||||
<td width=113 valign=top style='width:84.55pt;background:#F2F2F2;padding:
|
<td width=113 valign=top style='width:84.55pt;background:#F2F2F2;padding:
|
||||||
0in 5.4pt 0in 5.4pt ; margin-right: 10.25pt'>
|
0in 5.4pt 0in 5.4pt ; margin-right: 10.25pt'>
|
||||||
<p class=MsoNormal align=center style='text-align:center'><b><span
|
<p class=MsoNormal align=center style='text-align:center'><b><span
|
||||||
style='font-size:9.0pt;font-family:"Garamond",serif;color:black'>{{$hyper->lastname}}</span></b>
|
style='font-size:9.0pt;font-family:"Garamond",serif;color:black'>{{$hyper->network}}</span></b>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -211,7 +211,7 @@ color:black'>Le numérique au service de l'inclusion financière</span></p>
|
||||||
<td width=142 valign=top style='width:106.35pt;border:none;border-right:solid #7F7F7F 1.0pt;
|
<td width=142 valign=top style='width:106.35pt;border:none;border-right:solid #7F7F7F 1.0pt;
|
||||||
background:white;padding:0in 5.4pt 0in 5.4pt'>
|
background:white;padding:0in 5.4pt 0in 5.4pt'>
|
||||||
<p class=MsoNormal align=right style='text-align:right'><i><span
|
<p class=MsoNormal align=right style='text-align:right'><i><span
|
||||||
style='font-size:9.0pt;font-family:"Garamond",serif;color:black'>{{__('messages.insurance_name')}}</span></i>
|
style='font-size:9.0pt;font-family:"Garamond",serif;color:black'>{{__('messages.institution_name')}}</span></i>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td width=180 valign=top style='width:134.65pt;padding:0in 5.4pt 0in 5.4pt'>
|
<td width=180 valign=top style='width:134.65pt;padding:0in 5.4pt 0in 5.4pt'>
|
||||||
|
|
Loading…
Reference in New Issue