mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
commit
9d6153f62b
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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代表全量修改
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user