MongoCardJob

This commit is contained in:
邓皓元 2019-03-25 17:25:57 +08:00
parent ddeafedd8a
commit 56607abee1
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,7 @@ class Kernel extends ConsoleKernel
{
$logPath = storage_path('logs/artisan.log');
$schedule->command('real:sync-activated')->cron('* */4 * * *')->withoutOverlapping()->appendOutputTo($logPath);
$schedule->command('real:sync-cancelled')->cron('* */4 * * *')->withoutOverlapping()->appendOutputTo($logPath);
}
/**

View File

@ -5,6 +5,7 @@ namespace App\Domains\Real\Commands\Sync;
use Carbon\Carbon;
use App\Models\Real\Order;
use Illuminate\Support\Facades\DB;
use App\Domains\Card\Jobs\MongoCardJob;
use App\Models\Real\OrderCardPartition;
use App\Domains\Real\Repositories\OrderRepository;
use App\Domains\Real\Repositories\CompanyRepository;
@ -53,6 +54,8 @@ class OrderBaseSync extends Command
$value['virtual_order_id'] = $orders[$value['sim']] ?? 0;
}
MongoCardJob::dispatch(array_pluck($data, 'sim'));
DB::table('real_order_cards')->upsert($data, ['sim', 'deleted_at'], []);
}
app(OrderCardPartitionRepository::class)->forgetCached();