update requst dan final log
This commit is contained in:
@@ -581,6 +581,7 @@ class MemberEnrollmentService
|
||||
"telephone_mobile" => $row['telephone_mobile'] ?? null,
|
||||
"telephone_res" => $row['telephone_res'] ?? null,
|
||||
"telephone_office" => $row['telephone_office'] ?? null,
|
||||
"suspended" => $row['member_suspended'] ?? null,
|
||||
];
|
||||
// $this->validateRow($row);
|
||||
if (!isset($corporate->currentPolicy) || $corporate->currentPolicy->code != $row['policy_number']) {
|
||||
@@ -895,46 +896,46 @@ class MemberEnrollmentService
|
||||
// }
|
||||
|
||||
// Update plan
|
||||
$plans = explode(",",$row['plan_id']);
|
||||
if (count($plans) > 0) {
|
||||
foreach($plans as $d){
|
||||
$plan = Plan::query()
|
||||
->where('code', $d)
|
||||
->where('corporate_id', $corporate->id)
|
||||
->first();
|
||||
if (!$plan) {
|
||||
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||
}
|
||||
$member->memberPlans()->updateOrCreate([
|
||||
'member_id' => $member->id,
|
||||
'plan_id' => $plan->id,
|
||||
],
|
||||
[
|
||||
'plan_id' => $plan->id,
|
||||
'status' => 'active',
|
||||
'start' => $this->dateParser($row['member_effective_date']),
|
||||
'end' => $this->dateParser($row['member_expiry_date']),
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$plan = Plan::query()
|
||||
->where('code', $row['plan_id'])
|
||||
->where('corporate_id', $corporate->id)
|
||||
->first();
|
||||
if (!$plan) {
|
||||
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||
}
|
||||
$member->memberPlans()->updateOrCreate([
|
||||
'member_id' => $member->id,
|
||||
'plan_id' => $plan->id,
|
||||
],
|
||||
[
|
||||
'plan_id' => $plan->id,
|
||||
'status' => 'active',
|
||||
'start' => $this->dateParser($row['member_effective_date']),
|
||||
'end' => $this->dateParser($row['member_expiry_date']),
|
||||
]);
|
||||
}
|
||||
// $plans = explode(",",$row['plan_id']);
|
||||
// if (count($plans) > 0) {
|
||||
// foreach($plans as $d){
|
||||
// $plan = Plan::query()
|
||||
// ->where('code', $d)
|
||||
// ->where('corporate_id', $corporate->id)
|
||||
// ->first();
|
||||
// if (!$plan) {
|
||||
// throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||
// }
|
||||
// $member->memberPlans()->updateOrCreate([
|
||||
// 'member_id' => $member->id,
|
||||
// 'plan_id' => $plan->id,
|
||||
// ],
|
||||
// [
|
||||
// 'plan_id' => $plan->id,
|
||||
// 'status' => 'active',
|
||||
// 'start' => $this->dateParser($row['member_effective_date']),
|
||||
// 'end' => $this->dateParser($row['member_expiry_date']),
|
||||
// ]);
|
||||
// }
|
||||
// } else {
|
||||
// $plan = Plan::query()
|
||||
// ->where('code', $row['plan_id'])
|
||||
// ->where('corporate_id', $corporate->id)
|
||||
// ->first();
|
||||
// if (!$plan) {
|
||||
// throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||
// }
|
||||
// $member->memberPlans()->updateOrCreate([
|
||||
// 'member_id' => $member->id,
|
||||
// 'plan_id' => $plan->id,
|
||||
// ],
|
||||
// [
|
||||
// 'plan_id' => $plan->id,
|
||||
// 'status' => 'active',
|
||||
// 'start' => $this->dateParser($row['member_effective_date']),
|
||||
// 'end' => $this->dateParser($row['member_expiry_date']),
|
||||
// ]);
|
||||
// }
|
||||
|
||||
|
||||
// end update plan
|
||||
|
||||
Reference in New Issue
Block a user