diff --git a/app/Console/Commands/DeleteKttQuery.php b/app/Console/Commands/DeleteKttQuery.php index 2746f8f..3043ec1 100644 --- a/app/Console/Commands/DeleteKttQuery.php +++ b/app/Console/Commands/DeleteKttQuery.php @@ -54,12 +54,12 @@ class DeleteKttQuery extends Command $this->info('删除增量查订单: ' . $count); $count = Log::query()->where('target_field', 'pdd.ktt.goods.incr.quantity') - ->where('created_at', '<', date('Y-m-d H:i:s', strtotime('-2 day'))) + ->where('created_at', '<', date('Y-m-d H:i:s', strtotime('-3 day'))) ->delete(); $this->info('删除快团团更新库存: ' . $count); $count = Log::query()->where('target_field', '更新库存') - ->where('created_at', '<', date('Y-m-d H:i:s', strtotime('-2 day'))) + ->where('created_at', '<', date('Y-m-d H:i:s', strtotime('-3 day'))) ->delete(); $this->info('删除妙选更新库存: ' . $count); } diff --git a/app/Listeners/StockWarning.php b/app/Listeners/StockWarning.php index cb33eed..3d5d52a 100644 --- a/app/Listeners/StockWarning.php +++ b/app/Listeners/StockWarning.php @@ -22,7 +22,7 @@ class StockWarning implements ShouldQueue public function handle($event) { - if (isset($event->goodsSku->stock)) { + if (isset($event->goodsSku)) { $event->goodsSku->status = 2; if (0 >= $event->goodsSku->stock) { $event->goodsSku->status = 0; diff --git a/app/Services/Business/BusinessClient.php b/app/Services/Business/BusinessClient.php index f1e7ba4..a25f182 100644 --- a/app/Services/Business/BusinessClient.php +++ b/app/Services/Business/BusinessClient.php @@ -37,7 +37,7 @@ abstract class BusinessClient { $shopId = $this->getShop()->id; foreach ($orders as $order) { - unset($order['custom_item_list'], $order['logistics_list'], $order['gift_order_list']); + unset($order['custom_item_list'], $order['logistics_list'], $order['gift_order_list'], $order['updated_at']); $order['shop_id'] = $shopId; $orderRecord = BusinessOrder::firstOrNew(['shop_id' => $shopId, 'order_sn' => $order['order_sn']], $order); if (empty($orderRecord->id)) { diff --git a/app/Services/Business/KuaiTuanTuan/Goods.php b/app/Services/Business/KuaiTuanTuan/Goods.php index 7c73f5e..01b9315 100644 --- a/app/Services/Business/KuaiTuanTuan/Goods.php +++ b/app/Services/Business/KuaiTuanTuan/Goods.php @@ -68,7 +68,7 @@ class Goods $type = 'pdd.ktt.goods.incr.quantity'; $appendParams = [ 'goods_id' => $goodsId, - 'quantity_delta' => max($quantity, 0), + 'quantity_delta' => $quantity, 'sku_id' => $skuId, // 非必填 'modify_quantity_type' => $modifyType, // 修改库存的类型,不传或1代表增量修改,2代表全量修改 diff --git a/app/Services/Business/MiaoXuan/Goods.php b/app/Services/Business/MiaoXuan/Goods.php index 44a0a0f..8276fa6 100644 --- a/app/Services/Business/MiaoXuan/Goods.php +++ b/app/Services/Business/MiaoXuan/Goods.php @@ -20,7 +20,7 @@ class Goods { return [ 'data' => [ - 'stock' => max($quantity, 0), + 'stock' => $quantity, 'business_sku_id' => $businessGoods['sku_id'], 'business_goods_id' => $businessGoods['goods_id'], 'erp_shop_id' => $shopId,