Merge pull request !134 from develop
This commit is contained in:
赵世界 2022-11-15 06:52:21 +00:00 committed by Gitee
commit 9d6153f62b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 6 additions and 6 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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)) {

View File

@ -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代表全量修改

View File

@ -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,