|
|
@@ -271,17 +271,21 @@ class CourseList extends Component
|
|
|
|
|
|
public function newPayment($course_id, $months, $member_id, $id, $subscription)
|
|
|
{
|
|
|
+
|
|
|
$newMonths = array();
|
|
|
- $mm = explode(",", $months);
|
|
|
- foreach($mm as $month)
|
|
|
+ if ($months != '')
|
|
|
{
|
|
|
- if ($month < 5) $month += 12;
|
|
|
- if ($month >= 5) $month -= 4;
|
|
|
- $newMonths[] = $month;
|
|
|
+ $mm = explode(",", $months);
|
|
|
+ foreach($mm as $month)
|
|
|
+ {
|
|
|
+ if ($month < 5) $month += 12;
|
|
|
+ if ($month >= 5) $month -= 4;
|
|
|
+ $newMonths[] = $month;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$c = \App\Models\Course::findOrFail($course_id);
|
|
|
- return redirect()->to('/in?new=1&memberId=' . $member_id . '&causalId=' . $c->causal_id . '&subCausalId=' . $c->sub_causal_id . '&createSubscription=' . ($subscription ? 1 : 0) . '&months=' . implode("|", $newMonths) . '&price=' . $c->price . '&subscription_price=' . $c->subscription_price . "&courseId=" . $id);
|
|
|
+ return redirect()->to('/in?new=1&memberId=' . $member_id . (sizeof($newMonths) > 0 ? '&causalId=' . $c->causal_id : '') . '&subCausalId=' . $c->sub_causal_id . '&createSubscription=' . ($subscription ? 1 : 0) . (sizeof($newMonths) > 0 ? '&months=' . implode("|", $newMonths) : '') . (sizeof($newMonths) > 0 ? '&price=' . $c->price : '') . '&subscription_price=' . $c->subscription_price . "&courseId=" . $id);
|
|
|
|
|
|
}
|
|
|
/*
|