Calc Limit

This commit is contained in:
R
2022-12-14 13:16:01 +07:00
parent 74aa5f0486
commit 1baaf80b2b
2 changed files with 16 additions and 10 deletions

View File

@@ -23,9 +23,9 @@ class MemberResources extends JsonResource
'status' => $this->active
]),
'limit' => [
'current' => 2000000,
'total' => 4000000,
'percentage' => (2000000 / 4000000) * 100
'current' => $this->claims_sum_total_claim,
'total' => $this->currentPlan->limit_rules ?? 0,
'percentage' => (!empty($this->currentPlan->limit_rules ?? 0)) ? (($this->claims_sum_total_claim / $this->currentPlan->limit_rules) * 100) : 0
],
];
}