#10 Promotion Modul, Kommentar 2

This commit is contained in:
Kevin Adametz 2021-11-09 18:40:18 +01:00
parent f0da981737
commit c9e1545693
128 changed files with 8194 additions and 637 deletions

View file

@ -60,8 +60,8 @@ class WizardController extends Controller
$data = [
'user' => Auth::user(),
'step' => $step,
'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->where('show_at', '=', 5)->orderBy('pos', 'ASC')->get(),
'products' => Product::where('active', true)->whereJsonContains('show_on', ['4', '5'])->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->whereJsonContains('show_on', '6')->orderBy('pos', 'ASC')->get(),
'userHistoryWizardPayment' => $userHistoryWizardPayment,
];
@ -96,8 +96,9 @@ class WizardController extends Controller
'user' => Auth::user(),
'step' => $step,
'user_levels' => UserLevel::where('active', true)->get(),
//'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
//'products_on_board' => Product::where('active', true)->where('show_at', '=', 5)->orderBy('pos', 'ASC')->get(),
//'products' => Product::where('active', true)->whereJsonContains('show_on', ['4', '5'])->orderBy('pos', 'ASC')->get(),
//'products_on_board' => Product::where('active', true)->whereJsonContains('show_on', '6')->orderBy('pos', 'ASC')->get(),
];
if($step == 5){
return view('user.wizard.register_release', $data);
@ -125,8 +126,8 @@ class WizardController extends Controller
$data = [
'user' => Auth::user(),
'step' => 0,
'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->where('show_at', '=', 5)->orderBy('pos', 'ASC')->get(),
'products' => Product::where('active', true)->whereJsonContains('show_on', ['4', '5'])->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->whereJsonContains('show_on', '6')->orderBy('pos', 'ASC')->get(),
'userHistoryWizardPayment' => $userHistoryWizardPayment,
];
@ -161,8 +162,8 @@ class WizardController extends Controller
'user' => Auth::user(),
'step' => $step,
'user_levels' => UserLevel::where('active', true)->get(),
//'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
//'products_on_board' => Product::where('active', true)->where('show_at', '=', 5)->orderBy('pos', 'ASC')->get(),
//'products' => Product::where('active', true)->whereJsonContains('show_on', ['4', '5'])->orderBy('pos', 'ASC')->get(),
//'products_on_board' => Product::where('active', true)->whereJsonContains('show_on', '6')->orderBy('pos', 'ASC')->get(),,
];
$user->wizard = 0;
$user->save();
@ -342,8 +343,8 @@ class WizardController extends Controller
$data = [
'user' => Auth::user(),
'step' => $step,
'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->where('show_at', '=', 5)->orderBy('pos', 'ASC')->get(),
'products' => Product::where('active', true)->whereJsonContains('show_on', ['4', '5'])->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->whereJsonContains('show_on', '6')->orderBy('pos', 'ASC')->get(),
];
$user->wizard = 10;
$user->save();
@ -381,8 +382,8 @@ class WizardController extends Controller
$data = [
'user' => Auth::user(),
'step' => $step,
'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->where('show_at', '=', 5)->orderBy('pos', 'ASC')->get(),
'products' => Product::where('active', true)->whereJsonContains('show_on', ['4', '5'])->orderBy('pos', 'ASC')->get(),
'products_on_board' => Product::where('active', true)->whereJsonContains('show_on', '6')->orderBy('pos', 'ASC')->get(),
];
return view('user.wizard.create', $data)->withErrors($validator);
}
@ -457,7 +458,7 @@ class WizardController extends Controller
$user->abo_options = true;
$user->save();
}*/
if($product && $product->active && $product->show_at == 3){
if($product && $product->active){
//set membership product
$image = "";
if($product->images->count()){