Fix Import Benefit selecting wrong plan from another corporate

This commit is contained in:
R
2023-02-01 01:37:53 +07:00
parent 248047006e
commit 8d5f4bb0bd

View File

@@ -91,7 +91,9 @@ class CorporateService
$this->validateBenefitRow($benefit_data);
$plan = Plan::where('corporate_plan_id', $benefit_data['plan_code'])->first();
$plan = $corporate->plans()
->where('corporate_plan_id', $benefit_data['plan_code'])
->first();
// $corporate->plans->where('corporate_plan_id', $benefit_data['plan_code'])->first();
$benefit_data['plan_code'] = $plan->id;