update benefit import
This commit is contained in:
@@ -245,14 +245,13 @@ class CorporateService
|
|||||||
->where('corporate_plan_id', $benefit_data['plan_code'])
|
->where('corporate_plan_id', $benefit_data['plan_code'])
|
||||||
->first();
|
->first();
|
||||||
$benefit_data['plan_code'] = $plan->id;
|
$benefit_data['plan_code'] = $plan->id;
|
||||||
$benefit = Benefit::updateOrCreate([
|
$benefit = Benefit::firstOrCreate([
|
||||||
'code' => $benefit_data['code'],
|
'code' => $benefit_data['code'],
|
||||||
'service_code' => $plan->service_code,
|
'service_code' => $plan->service_code,
|
||||||
], [
|
], [
|
||||||
'code' => $benefit_data['code'],
|
'description' => $benefit_data['description'], // hanya initial
|
||||||
'service_code' => $plan->service_code,
|
|
||||||
'description' => $benefit_data['description'],
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$corporateBenefit = $corporate->corporateBenefits()->updateOrCreate([
|
$corporateBenefit = $corporate->corporateBenefits()->updateOrCreate([
|
||||||
'benefit_id' => $benefit->id,
|
'benefit_id' => $benefit->id,
|
||||||
'plan_id' => $plan->id,
|
'plan_id' => $plan->id,
|
||||||
|
|||||||
Reference in New Issue
Block a user