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
c7b595598f
commit
dc6a013456
@ -54,12 +54,12 @@ class DeleteKttQuery extends Command
|
|||||||
$this->info('删除增量查订单: ' . $count);
|
$this->info('删除增量查订单: ' . $count);
|
||||||
|
|
||||||
$count = Log::query()->where('target_field', 'pdd.ktt.goods.incr.quantity')
|
$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();
|
->delete();
|
||||||
$this->info('删除快团团更新库存: ' . $count);
|
$this->info('删除快团团更新库存: ' . $count);
|
||||||
|
|
||||||
$count = Log::query()->where('target_field', '更新库存')
|
$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();
|
->delete();
|
||||||
$this->info('删除妙选更新库存: ' . $count);
|
$this->info('删除妙选更新库存: ' . $count);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class StockWarning implements ShouldQueue
|
|||||||
|
|
||||||
public function handle($event)
|
public function handle($event)
|
||||||
{
|
{
|
||||||
if (isset($event->goodsSku->stock)) {
|
if (isset($event->goodsSku)) {
|
||||||
$event->goodsSku->status = 2;
|
$event->goodsSku->status = 2;
|
||||||
if (0 >= $event->goodsSku->stock) {
|
if (0 >= $event->goodsSku->stock) {
|
||||||
$event->goodsSku->status = 0;
|
$event->goodsSku->status = 0;
|
||||||
|
|||||||
@ -37,7 +37,7 @@ abstract class BusinessClient
|
|||||||
{
|
{
|
||||||
$shopId = $this->getShop()->id;
|
$shopId = $this->getShop()->id;
|
||||||
foreach ($orders as $order) {
|
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;
|
$order['shop_id'] = $shopId;
|
||||||
$orderRecord = BusinessOrder::firstOrNew(['shop_id' => $shopId, 'order_sn' => $order['order_sn']], $order);
|
$orderRecord = BusinessOrder::firstOrNew(['shop_id' => $shopId, 'order_sn' => $order['order_sn']], $order);
|
||||||
if (empty($orderRecord->id)) {
|
if (empty($orderRecord->id)) {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class Goods
|
|||||||
$type = 'pdd.ktt.goods.incr.quantity';
|
$type = 'pdd.ktt.goods.incr.quantity';
|
||||||
$appendParams = [
|
$appendParams = [
|
||||||
'goods_id' => $goodsId,
|
'goods_id' => $goodsId,
|
||||||
'quantity_delta' => max($quantity, 0),
|
'quantity_delta' => $quantity,
|
||||||
'sku_id' => $skuId,
|
'sku_id' => $skuId,
|
||||||
// 非必填
|
// 非必填
|
||||||
'modify_quantity_type' => $modifyType, // 修改库存的类型,不传或1代表增量修改,2代表全量修改
|
'modify_quantity_type' => $modifyType, // 修改库存的类型,不传或1代表增量修改,2代表全量修改
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class Goods
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'data' => [
|
'data' => [
|
||||||
'stock' => max($quantity, 0),
|
'stock' => $quantity,
|
||||||
'business_sku_id' => $businessGoods['sku_id'],
|
'business_sku_id' => $businessGoods['sku_id'],
|
||||||
'business_goods_id' => $businessGoods['goods_id'],
|
'business_goods_id' => $businessGoods['goods_id'],
|
||||||
'erp_shop_id' => $shopId,
|
'erp_shop_id' => $shopId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user