Subversion-Projekte lars-tiefland.laravel_shop

Revision

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

Revision 1619 Revision 1620
Zeile 365... Zeile 365...
365
        {
365
        {
366
            if ( $dir->articlemaster == 1 )
366
            if ( $dir->articlemaster == 1 )
367
            {
367
            {
368
                $preise = array();
368
                $preise = array();
369
                $items = Item::with( 'price' )->where( "directory_id", $dir->id )->whereIn( "status", [ 0, 2 ] )->get();
369
                $items = Item::with( 'price' )->where( "directory_id", $dir->id )->whereIn( "status", [ 0, 2 ] )->get();
370
                foreach ( $items as $item )
370
                $dir->anz = count( $items );
371
                {
-
 
372
                    $preise[] = $item->price[0]->preis;
-
 
373
                }
-
 
374
                if ( $preise )
371
                if ( $items )
375
                {
372
                {
-
 
373
                    foreach ( $items as $item )
-
 
374
                    {
-
 
375
                        $preise[] = $item->price[0]->preis;
-
 
376
                    }
376
                    $startPrice = min( $preise );
377
                    $startPrice = min( $preise );
377
                    $dir->anz = count( $items );
-
 
378
                    $dir->mehrerePreise = count( array_unique( $preise ) ) > 1;
378
                    $dir->mehrerePreise = count( array_unique( $preise ) ) > 1;
379
                    $dir->startpreis_tpl = $startPrice;
379
                    $dir->startpreis_tpl = $startPrice;
380
                }
380
                }
381
                $subdir["items"] = $dirs->filter( function ( $value )
381
                $subdir["items"] = $dirs->filter( function ( $value )
382
                {
382
                {
383
                    return $value->articlemaster == 1;
383
                    return $value->articlemaster == 1 && $value->anz > 0;
384
                } );
384
                } );
385
                /*$artstaemmeItems[$dir->id] = $dir;
385
                /*$artstaemmeItems[$dir->id] = $dir;
386
                $artstaemmeItems[$dir->id]["items"] = Item::with( 'medium.medium', 'price', 'manufacturer' )->where( 'directory_id', '=', $dir->id )->where( 'status', '=', 0 )->get();*/
386
                $artstaemmeItems[$dir->id]["items"] = Item::with( 'medium.medium', 'price', 'manufacturer' )->where( 'directory_id', '=', $dir->id )->where( 'status', '=', 0 )->get();*/
387
            }
387
            }
388
        }
388
        }