mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
feat: #10000 增量订单获取优化
This commit is contained in:
parent
229769bb6e
commit
79a5caa591
@ -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');
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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代表全量修改
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user