tambah data total_premi dan limit_rules pada page request log halaman dashboard
This commit is contained in:
@@ -131,6 +131,26 @@ class MemberController extends Controller
|
||||
|
||||
$res_data['companies'] = $companies;
|
||||
|
||||
$corporateEmployeePremi = DB::table('corporate_employees')
|
||||
->leftJoin('corporates', 'corporates.id', '=', 'corporate_employees.corporate_id')
|
||||
->leftJoin('corporate_policies', 'corporate_policies.corporate_id', '=', 'corporates.id')
|
||||
->where('corporate_employees.status', 'ACTIVE')
|
||||
->where('corporates.active', 1)
|
||||
->where('corporate_policies.active', 1)
|
||||
->where('corporate_employees.member_id', $members->id)
|
||||
->value('corporate_policies.total_premi');
|
||||
|
||||
$res_data['total_premi'] = $corporateEmployeePremi ?? 0;
|
||||
|
||||
$limitRules = DB::table('member_plans')
|
||||
->leftJoin('plans', 'plans.id', '=', 'member_plans.plan_id')
|
||||
->where('member_plans.member_id', $members->id)
|
||||
->where('member_plans.status', 'active')
|
||||
->where('plans.active', 1)
|
||||
->value('plans.limit_rules');
|
||||
|
||||
$res_data['limit_rules'] = $limitRules ?? 0;
|
||||
|
||||
// specialities
|
||||
$specialities = DB::table('specialities')
|
||||
->select(
|
||||
|
||||
@@ -112,6 +112,14 @@ export default function DialogMember(member:any, handleSubmitSuccess:() => void)
|
||||
<Typography sx={{width:'50%'}} variant="body2">Policy Number</Typography>
|
||||
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.members.policy_id ?? '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction="row" justifyContent="space-between">
|
||||
<Typography sx={{width:'50%'}} variant="body2">Deposit Corporate</Typography>
|
||||
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.total_premi ? fCurrency(member?.total_premi) : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction="row" justifyContent="space-between">
|
||||
<Typography sx={{width:'50%'}} variant="body2">Limit Peserta</Typography>
|
||||
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{ member?.limit_rules ? fCurrency(member?.limit_rules) : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction="row" justifyContent="space-between">
|
||||
<Typography sx={{width:'50%'}} variant="body2">NRIC</Typography>
|
||||
<Typography sx={{width:'50%', fontWeight: 'bold'}} variant="body2">{member?.members.nik ?? '-'}</Typography>
|
||||
|
||||
Reference in New Issue
Block a user