Berater bestellungen kleine Änderungen

This commit is contained in:
Kevin Adametz 2020-09-15 17:46:39 +02:00
parent c4ed6b39db
commit 74923859d1
8 changed files with 64 additions and 49 deletions

View file

@ -24,6 +24,8 @@ class OrderController extends Controller
public function __construct()
{
$this->middleware('superadmin');
$this->middleware('active.account');
}
@ -270,9 +272,29 @@ class OrderController extends Controller
public function datatable(){
$show_at = 1;
// $user = User::find(\Auth::user()->id);
$query = Product::select('products.*')->where('active', true)
->where('show_at', '=', 1); //Kunden und Berater
;
if(Request::get('shipping_is_for') === 'me'){
$query = Product::select('products.*')->where('active', true)->where(function ($q) {
$q->where('show_at', '=', 1)
->orWhere('show_at', '=', 2)
->orWhere('show_at', '=', 6);
});
}else{
$query = Product::select('products.*')->where('active', true)->where(function ($q) {
$q->where('show_at', '=', 0)
->orWhere('show_at', '=', 1);
});
}
//Kunden und Berater
//->orWhere('show_at', '=', 2); // Nur Berater
//->orderBy('pos', 'DESC')
//->orderBy('id', 'DESC');

View file

@ -188,6 +188,7 @@ class Product extends Model
3 => 'Registrierung / Mitgliedschaft Berater',
4 => 'Nur Mitgliedschaft Berater',
5 => 'Onboarding Berater',
6 => 'Onboarding Berater + Berater Shop',
];