formatting
This commit is contained in:
parent
a3d62187dd
commit
47c21543bd
@ -8,21 +8,21 @@ use App\Utilities\Reports as Utility;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
class ReportReminder extends Command
|
class ReportCache extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The name and signature of the console command.
|
* The name and signature of the console command.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'reminder:report';
|
protected $signature = 'report:cache';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Calculate reminders for reports';
|
protected $description = 'Calculate and cache reports';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
@ -43,18 +43,18 @@ class ReportReminder extends Command
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->info('Calculate report reminders for ' . $company->name . ' company.');
|
$this->info('Calculating reports for ' . $company->name . ' company.');
|
||||||
|
|
||||||
// Set company
|
// Set company
|
||||||
$company->makeCurrent();
|
$company->makeCurrent();
|
||||||
|
|
||||||
$this->remind();
|
$this->cacheReportsOfCurrentCompany();
|
||||||
}
|
}
|
||||||
|
|
||||||
Company::forgetCurrent();
|
Company::forgetCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function remind()
|
protected function cacheReportsOfCurrentCompany()
|
||||||
{
|
{
|
||||||
$reports = Report::orderBy('name')->get();
|
$reports = Report::orderBy('name')->get();
|
||||||
|
|
@ -29,7 +29,7 @@ class Kernel extends ConsoleKernel
|
|||||||
|
|
||||||
$schedule_time = config('app.schedule_time');
|
$schedule_time = config('app.schedule_time');
|
||||||
|
|
||||||
$schedule->command('reminder:report')->everySixHours();
|
$schedule->command('report:cache')->everySixHours();
|
||||||
$schedule->command('reminder:invoice')->dailyAt($schedule_time);
|
$schedule->command('reminder:invoice')->dailyAt($schedule_time);
|
||||||
$schedule->command('reminder:bill')->dailyAt($schedule_time);
|
$schedule->command('reminder:bill')->dailyAt($schedule_time);
|
||||||
$schedule->command('recurring:check')->dailyAt($schedule_time);
|
$schedule->command('recurring:check')->dailyAt($schedule_time);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user