Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1668 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1668 Revision 1713
Zeile 27... Zeile 27...
27
         *
27
         *
28
         * @return int
28
         * @return int
29
         */
29
         */
30
        public function handle(): int
30
        public function handle(): int
31
        {
31
        {
32
            @mkdir( public_path( "preisagentur" ), 0755, true );
-
 
33
            $items = Item::with( 'price', 'medium.medium', "manufacturer" )->where( 'status', 0 )->get();
32
            $items = Item::with( 'price', 'medium.medium', "manufacturer" )->where( 'status', 0 )->get();
34
            $agencies = PriceAgency::where( 'shop_id', $GLOBALS["INI"]["shops_ID"] )->where( "status", "1" )->get();
33
            $agencies = PriceAgency::where( 'shop_id', $GLOBALS["INI"]["shops_ID"] )->where( "status", "1" )->get();
35
            foreach ( $agencies as $agency )
34
            foreach ( $agencies as $agency )
36
            {
35
            {
37
                $locked_manufacturers = json_decode( $agency->locked_manufacturers, true );
36
                $locked_manufacturers = json_decode( $agency->locked_manufacturers, true );
Zeile 51... Zeile 50...
51
                    $this->error( "Konfigurationsdatei " . $configFile . " existiert nicht!" );
50
                    $this->error( "Konfigurationsdatei " . $configFile . " existiert nicht!" );
52
                    continue;
51
                    continue;
53
                }
52
                }
54
                require $configFile;
53
                require $configFile;
55
                $fName = basename( parse_url( $agency["csv_url"], PHP_URL_PATH ) );
54
                $fName = basename( parse_url( $agency["csv_url"], PHP_URL_PATH ) );
56
                $fName = storage_path() . "/" . $fName;
55
                $fName = storage_path( "preisagentur" ) . "/" . $fName;
57
                $f = fopen( $fName, "w" );
56
                $f = fopen( $fName, "w" );
58
                if ( $prefix )
57
                if ( $prefix )
59
                {
58
                {
60
                    fwrite( $f, $prefix . "\n" );
59
                    fwrite( $f, $prefix . "\n" );
61
                }
60
                }