promotion 1.0

This commit is contained in:
Kevin Adametz 2021-12-25 02:51:22 +01:00
parent 1cc8e025a1
commit 570d428b1c
60 changed files with 1596 additions and 272 deletions

View file

@ -38,7 +38,10 @@ class PromotionController extends Controller
if($user_promotion->user_id != Auth::user()->id){
abort(404);
}
$user_promotion->about_you = !$user_promotion->about_you ? $user_promotion->user->account->about_you : $user_promotion->about_you;
$user_promotion->description = $user_promotion->description ? $user_promotion->description : $user_promotion->promotion_admin->user_description;
$about_you = $user_promotion->user->account->about_you ?$user_promotion->user->account->about_you : $user_promotion->promotion_admin->user_about;
$user_promotion->about_you = $user_promotion->about_you ? $user_promotion->about_you : $about_you;
$data = [
'checkPaymentCredit' => $user_promotion->checkPaymentCredit(),
'user_promotion_cart' => PromotionUser::preCalculateCart($user_promotion, 'user_promotion'),
@ -66,7 +69,6 @@ class PromotionController extends Controller
return redirect(route('user_promotion_detail', [$id]))->withErrors($validator)->withInput(Request::all());
}
$model = $this->promoRepo->update($id, Request::all());
}
\Session()->flash('alert-save', true);
return redirect(route('user_promotion_detail', [$model->id]));