%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/pjc/app/Console/Commands/
Upload File :
Create Path :
Current File : /var/www/pjc/app/Console/Commands/CheckScadenze.php

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use DB;

class CheckScadenze extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'Scadenze:check';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $scadute = DB::table('tsi_scadenziario')->where('data_scadenza', '<=', date('Y-m-d'))->get();
        
        foreach ($scadute as $item) {
            DB::table('tsi_scadenziario_cstm')->where('id_c', $item->id)->update(['conformita_c' => 'NO']);
        }
        $this->info($scadute);
    }
}

Zerion Mini Shell 1.0