Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1690 | Revision 1692 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1690 Revision 1691
Zeile 336... Zeile 336...
336
        //$item->load( 'price', 'medium.medium', 'manufacturer' );
336
        //$item->load( 'price', 'medium.medium', 'manufacturer' );
337
        return view( 'item', [
337
        return view( 'item', [
338
            "item" => $item,
338
            "item" => $item,
339
        ] );
339
        ] );
340
    } );
340
    } );
341
    Route::get( "/directory/{id}", function ( $id )
341
    Route::get( "/directory/{id}-{name}", function ( $id )
342
    {
342
    {
343
        list( $dirId, $dirName ) = explode( "-", $id, 2 );
-
 
344
        $_SESSION["navigation"]["position"] = $dirId;
343
        $_SESSION["navigation"]["position"] = $id;
345
        $subdir = Directory::with( 'medium.medium', 'template.template', 'manufacturer' )->where( "id", $dirId )->firstOrFail();
344
        $subdir = Directory::with( 'medium.medium', 'template.template', 'manufacturer' )->where( "id", $id )->firstOrFail();
346
        $dirs = Directory::with( 'medium.medium','manufacturer' )->where( "directory_id", $dirId )->whereIn( 'status', [
345
        $dirs = Directory::with( 'medium.medium','manufacturer' )->where( "directory_id", $id )->whereIn( 'status', [
347
            0,
346
            0,
348
            99
347
            99
349
        ] )->orderBy( 'kennung' )->orderBy( 'name' )->get();
348
        ] )->orderBy( 'kennung' )->orderBy( 'name' )->get();
350
        $items = Item::with( 'price', 'medium.medium', 'manufacturer' )->where( "directory_id", $dirId )->where( 'status', '=', 0 )->get();
349
        $items = Item::with( 'price', 'medium.medium', 'manufacturer' )->where( "directory_id", $id )->where( 'status', '=', 0 )->get();
351
        $subdir["subdirs"] = $dirs->reject( function ( $value )
350
        $subdir["subdirs"] = $dirs->reject( function ( $value )
352
        {
351
        {
353
            return $value->articlemaster == 1;
352
            return $value->articlemaster == 1;
354
        } );
353
        } );
355
        $subdir["items"] = $items;
354
        $subdir["items"] = $items;
Zeile 390... Zeile 389...
390
        }
389
        }
391
        return view( $template, [
390
        return view( $template, [
392
            "subdir"          => $subdir,
391
            "subdir"          => $subdir,
393
            "artstaemmeItems" => $artstaemmeItems,
392
            "artstaemmeItems" => $artstaemmeItems,
394
        ] );
393
        ] );
395
    } );
394
    } )->whereNumber('id');
396
    Route::get( '/', function ()
395
    Route::get( '/', function ()
397
    {
396
    {
398
        $date = date( "Y-m-d" );
397
        $date = date( "Y-m-d" );
399
        $aktion = Action::with( 'medium.medium' )->where( 'valid_from', '<=', $date )->where( 'valid_to', '>=', $date )->get();
398
        $aktion = Action::with( 'medium.medium' )->where( 'valid_from', '<=', $date )->where( 'valid_to', '>=', $date )->get();
400
        return view( 'startpage', [
399
        return view( 'startpage', [