feat: #10000 ktt订单获取优化

This commit is contained in:
赵世界 2023-04-06 14:01:52 +08:00
parent b68fd72c7e
commit d8d888b368
2 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class KttOrderQuery extends Command
{ {
$shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get(); $shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get();
$endTime = DateTimeUtils::getMicroTime(); $endTime = DateTimeUtils::getMicroTime();
$beginTime = $endTime - 60000; $beginTime = $endTime - 63000;
foreach ($shops as $shop) { foreach ($shops as $shop) {
BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime + 3000); BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime + 3000);
} }

View File

@ -6,6 +6,7 @@ use App\Services\Business\BusinessFactory;
use App\Utils\DateTimeUtils; use App\Utils\DateTimeUtils;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use App\Models\Shop; use App\Models\Shop;
use Illuminate\Support\Facades\Log;
use Swoole\Timer; use Swoole\Timer;
use Swoole\Event; use Swoole\Event;
@ -48,6 +49,7 @@ class Swoole extends Command
$shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get(); $shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get();
$endTime = DateTimeUtils::getMicroTime(); $endTime = DateTimeUtils::getMicroTime();
$beginTime = $endTime - 3000; $beginTime = $endTime - 3000;
Log::info($beginTime . '--' . $endTime + 3000);
foreach ($shops as $shop) { foreach ($shops as $shop) {
BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime + 3000, 'increment'); BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime + 3000, 'increment');
} }