feat: #10000 增量订单获取优化

This commit is contained in:
赵世界 2022-08-26 14:09:01 +08:00
parent 229769bb6e
commit 79a5caa591
3 changed files with 4 additions and 4 deletions

View File

@ -43,10 +43,10 @@ class Swoole extends Command
*/
public function handle()
{
Timer::tick(1000, function () {
Timer::tick(5000, function () {
$shops = Shop::query()->where('plat_id', 1)->where('status', 1)->get();
$endTime = DateTimeUtils::getMicroTime();
$beginTime = $endTime - 10000;
$beginTime = $endTime - 50000;
foreach ($shops as $shop) {
BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime, 'increment');
}

View File

@ -40,7 +40,7 @@ class UpdateBusinessGoodsStock implements ShouldQueue
$log->target_id = $event->goodsSku->id ?? 0;
$log->target_field = 'stock';
$log->user_id = 999;
$log->message = ($event->businessOrderItem['external_sku_id'] ?? $event->businessOrderItem['id']) . '未找到';
$log->message = '未找到' . json_encode($event->businessOrderItem, 256);
$log->save();
return;

View File

@ -56,7 +56,7 @@ class Goods
$type = 'pdd.ktt.goods.incr.quantity';
$appendParams = [
'goods_id' => $goodsId,
'quantity_delta' => $quantity,
'quantity_delta' => max($quantity, 0),
'sku_id' => $skuId,
// 非必填
'modify_quantity_type' => $modifyType, // 修改库存的类型不传或1代表增量修改2代表全量修改