rm: schedule add: custom date in artisan comand csvExport:generate con check date
This commit is contained in:
parent
3866a225ec
commit
3ced4077bf
2 changed files with 36 additions and 45 deletions
|
@ -2,8 +2,7 @@
|
|||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Commands\exportCsv;
|
||||
use App\Console\Commands\exportCsvCli;
|
||||
use App\Console\Commands\csvExport;
|
||||
use App\Http\Controllers\GiteaApiController\GiteaExport;
|
||||
use Dotenv\Dotenv;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
|
@ -17,7 +16,7 @@ class Kernel extends ConsoleKernel
|
|||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
exportCsv::class,
|
||||
csvExport::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -28,43 +27,5 @@ class Kernel extends ConsoleKernel
|
|||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->call(function () {
|
||||
$firstDay = date('Y-m-01'); // First day of the current month
|
||||
$lastDay = date('Y-m-t'); // Last day of the current month
|
||||
|
||||
$calculate_agent_cost = true;
|
||||
$third_party_integrations_allow = true;
|
||||
$third_party_integrations_nextcloud = true;
|
||||
$third_party_integrations_open_project = false;
|
||||
$email_send_allow = true;
|
||||
|
||||
$gitea_export = new GiteaExport(
|
||||
$calculate_agent_cost,
|
||||
$third_party_integrations_allow,
|
||||
$third_party_integrations_nextcloud,
|
||||
$third_party_integrations_open_project,
|
||||
$email_send_allow,
|
||||
);
|
||||
$gitea_export->export_issues($firstDay, $lastDay, ['state' => 'closed']);
|
||||
})->monthly();
|
||||
$schedule->call(function () {
|
||||
$firstDay = date('Y-m-01'); // First day of the current month
|
||||
$lastDay = date('Y-m-t'); // Last day of the current month
|
||||
|
||||
$calculate_agent_cost = true;
|
||||
$third_party_integrations_allow = true;
|
||||
$third_party_integrations_nextcloud = false;
|
||||
$third_party_integrations_open_project = false;
|
||||
$email_send_allow = true;
|
||||
|
||||
$gitea_export = new GiteaExport(
|
||||
$calculate_agent_cost,
|
||||
$third_party_integrations_allow,
|
||||
$third_party_integrations_nextcloud,
|
||||
$third_party_integrations_open_project,
|
||||
$email_send_allow,
|
||||
);
|
||||
$gitea_export->export_issues($firstDay, $lastDay, ['state' => 'closed']);
|
||||
})->everyFiveMinutes();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue