Subversion-Projekte lars-tiefland.laravel_shop

Revision

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

Revision 1612 Revision 1613
Zeile 349... Zeile 349...
349
        $subdir["subdirs"] = $dirs->reject( function ( $value, $key )
349
        $subdir["subdirs"] = $dirs->reject( function ( $value, $key )
350
        {
350
        {
351
            return $value->articlemaster == 1;
351
            return $value->articlemaster == 1;
352
        } );
352
        } );
353
        $subdir["items"] = $items;
353
        $subdir["items"] = $items;
354
        $subdir["itemTable"] = array();
-
 
355
        $template = 'subdir';
354
        $template = 'subdir';
356
        if ( $subdir->articlemaster == 1 )
355
        if ( $subdir->articlemaster == 1 )
357
        {
356
        {
358
            $template = 'artstamm';
357
            $template = 'artstamm';
359
        }
358
        }
Zeile 362... Zeile 361...
362
        {
361
        {
363
            $template = substr( $subdir->template[0]->template->template_value, strpos( $subdir->template[0]->template->template_value, "=" ) + 1 );
362
            $template = substr( $subdir->template[0]->template->template_value, strpos( $subdir->template[0]->template->template_value, "=" ) + 1 );
364
        }
363
        }
365
        foreach ( $dirs as $dir )
364
        foreach ( $dirs as $dir )
366
        {
365
        {
367
            $preise = array();
-
 
368
            if ( $dir->articlemaster == 1 )
366
            if ( $dir->articlemaster == 1 )
369
            {
367
            {
370
                $items = Item::with( 'price' )->where( "directory_id", $dir->id )->whereIn( "status", [ 0, 2 ] )->get();
-
 
371
                foreach ( $items as $item )
368
                $subdir["items"] = $dirs->filter( function ( $value, $key )
372
                {
369
                {
-
 
370
                    $items = Item::with( 'price' )->where( "directory_id", $value->id )->whereIn( "status", [ 0, 2 ] )->get();
-
 
371
                    foreach ( $items as $item )
-
 
372
                    {
373
                    $preise[] = $item->price[0]->preis;
373
                        $preise[$value->id][] = $item->price[0]->preis;
374
                }
374
                    }
375
                $startPrice = min( $preise );
375
                    $startPrice = min( $preise[$value->id] );
376
                $dir->startpreis_tpl = $startPrice;
376
                    $value->startpreis_tpl = $startPrice;
377
                $subdir["itemTable"][] = $dir;
377
                    return $value->articlemaster == 1;
-
 
378
                } );
378
                /*$artstaemmeItems[$dir->id] = $dir;
379
                /*$artstaemmeItems[$dir->id] = $dir;
379
                $artstaemmeItems[$dir->id]["items"] = Item::with( 'medium.medium', 'price', 'manufacturer' )->where( 'directory_id', '=', $dir->id )->where( 'status', '=', 0 )->get();*/
380
                $artstaemmeItems[$dir->id]["items"] = Item::with( 'medium.medium', 'price', 'manufacturer' )->where( 'directory_id', '=', $dir->id )->where( 'status', '=', 0 )->get();*/
380
            }
381
            }
381
        }
382
        }
382
        return view( $template, [
383
        return view( $template, [