23.11 Upload to live

This commit is contained in:
Kevin Adametz 2019-11-23 15:02:41 +01:00
parent 8cae2f92a4
commit 8ebdacec98
80 changed files with 7320 additions and 3937 deletions

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers\Web;
use App\Http\Controllers\Controller;
use App\Models\Category;
use App\Models\IqSite;
use App\Models\Product;
use Input;
use App\Services\Util;
@ -24,11 +25,14 @@ class SiteController extends Controller
public function index()
{
$products = ['aloe-vera-gel-99', 'aloe-vera-saft-500-ml', 'aloe-vera-lippenbalsam'];
$set_products = ['aloe-vera-cleaner-set', 'aloe-vera-koerper-set', 'aloe-vera-repair-set'];
// $set_products = ['aloe-vera-cleaner-set', 'aloe-vera-koerper-set', 'aloe-vera-repair-set'];
$set_products = ['aloe-vera-koerper-set', 'baby-set', 'aloe-vera-gel-set'];
$data = [
'products' => Product::whereIn('slug', $products)->where('active', true)->where('show_at', '<=', 1)->get(),
'set_products' => Product::whereIn('slug', $set_products)->where('active', true)->where('show_at', '<=', 1)->get(),
'user_shop' => Util::getUserShop(),
'site' => IqSite::find(1),
];
return view('web.index', $data);
}
@ -63,16 +67,21 @@ class SiteController extends Controller
if($subsite || $subsite != 'alle-produkte') {
$category = Category::where('slug', $subsite)->where('active', true)->first();
if ($category) {
$headline_image = false;
if($category->headline_image_id && $category->iq_image && $category->iq_image->active){
$headline_image = $category->iq_image;
}
$data = [
'user_shop' => Util::getUserShop(),
'subsite' => $subsite,
'categories' => Category::where('active', true)->orderBy('pos', 'ASC')->get(),
'products' => Product::whereHas('categories', function ($query) use ($category) {
$query->where('category_id', '=', $category->id);
})->where('active', true)->where('show_at', '<=', 1)->orderBy('pos', 'DESC')->get(),
'p_count' => Product::where('active', true)->where('show_at', '<=', 1)->count(),
'headline' => $category->getLang('headline'),
'headline_image' => $headline_image,
];
return view('web.templates.' . $site, $data);
@ -84,6 +93,8 @@ class SiteController extends Controller
'categories' => Category::where('active', true)->orderBy('pos', 'ASC')->get(),
'products' => Product::where('active', true)->where('show_at', '<=', 1)->orderBy('pos', 'ASC')->get(),
'p_count' => Product::where('active', true)->where('show_at', '<=', 1)->count(),
'headline' => 'Produktwelt',
'headline_image' => false,
];
return view('web.templates.'.$site, $data);
}