同步
This commit is contained in:
parent
bdff9f28bb
commit
a4f3b877ca
@ -28,7 +28,7 @@ class Kernel extends ConsoleKernel
|
||||
$logPath = storage_path('logs/artisan.log');
|
||||
$schedule->command('real:sync-activated')->cron('* */4 * * *')->withoutOverlapping()->appendOutputTo($logPath);
|
||||
$schedule->command('virtual:schedule-auto-activate')->cron('* * * 1 *')->withoutOverlapping()->appendOutputTo($logPath);
|
||||
$schedule->command('virtual:schedule-vd-activate')->cron('0 2 * * *')->withoutOverlapping()->appendOutputTo($logPath);
|
||||
// $schedule->command('virtual:schedule-vd-activate')->cron('0 2 * * *')->withoutOverlapping()->appendOutputTo($logPath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,6 +7,7 @@ use App\Models\Card\Card;
|
||||
use App\Models\Mongo\TblCard;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use App\Domains\Card\Repositories\CardRepository;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use App\Domains\Virtual\Repositories\OrderCardPartitionRepository;
|
||||
@ -22,8 +23,12 @@ class ActivatedSync extends Command
|
||||
public function handle()
|
||||
{
|
||||
$day = $this->getDay();
|
||||
$startMicrotime = new UTCDateTime($day->startOfDay());
|
||||
$endMicrotime = new UTCDateTime($day->endOfDay());
|
||||
$startMicrotime = new UTCDateTime($day->copy()->startOfDay());
|
||||
$endMicrotime = new UTCDateTime($day->copy()->endOfDay());
|
||||
|
||||
if ($this->option('month')) {
|
||||
$startMicrotime = new UTCDateTime($day->copy()->subMonth()->startOfMonth());
|
||||
}
|
||||
|
||||
$query = TblCard::where('pNo', 'No00000000768')->where('isDel', 0)
|
||||
->where('saDate', 'exists', true)
|
||||
@ -93,6 +98,13 @@ class ActivatedSync extends Command
|
||||
return Carbon::yesterday()->startOfDay();
|
||||
}
|
||||
|
||||
protected function getOptions()
|
||||
{
|
||||
return [
|
||||
['--month', null, InputOption::VALUE_NONE, '首次同步按月同步'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function getArguments()
|
||||
{
|
||||
return [
|
||||
|
Loading…
x
Reference in New Issue
Block a user