This commit is contained in:
邓皓元 2019-04-22 16:14:26 +08:00
parent 2d7763cc94
commit 559be53fb6

View File

@ -29,13 +29,21 @@ class VdActivated extends Command
$time = $datetime->copy()->subMonths(self::INTERVAL_MONTH);
$this->line('开始同步已在VD上未激活卡的激活数据');
$startMicrotime = new UTCDateTime($datetime->copy()->subMonth());
$cards = OrderCard::select('sim')->where('created_at', '>=', $time)
->whereNull('service_start_at')
->orderBy('created_at', 'desc')->get()->pluck('sim')->toArray();
$this->line('同步条数 #:' . count($cards));
$this->line('chunk');
foreach (array_chunk($cards, 1000) as $simArray) {
echo '.';
$simArray = array_map('strval', $simArray);
$res = TblCard::select(['cNo', 'saDate'])