mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
!246 bug
Merge pull request !246 from 杨建炊/fix-release-1.0.0/yjc-migrate
This commit is contained in:
commit
d6fadaae1e
@ -72,7 +72,7 @@ class BusinessOrdersUpdate
|
||||
$updateParam['status'] = GoodsSku::$STATUS_ON_SALE;
|
||||
}
|
||||
|
||||
Log::info("sku 业务订单库存更:{$this->goodsSku->id}", $updateParam);
|
||||
Log::info("sku 业务订单库存更:{$this->goodsSku->id},num:{$this->num}", [$updateParam, (array)$this->goodsSku]);
|
||||
//乐观锁更新
|
||||
return GoodsSku::query()->where('external_sku_id', $this->businessGoodSku['external_sku_id'])->
|
||||
where("stock", "=", $oldStock)->update($updateParam);
|
||||
|
||||
@ -224,6 +224,7 @@ class ShopsController extends Controller
|
||||
->get()
|
||||
->toArray();
|
||||
$business->batchIncrQuantity($businessGoodsSkus, $stock, false);
|
||||
usleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,13 @@ class DailyStockRecordController extends Controller
|
||||
$query->where('external_sku_id', '=', $request->external_sku_id);
|
||||
});
|
||||
}
|
||||
$dailyStockRecord = $build->orderByDesc("id")->paginate($request->get('per_page'));
|
||||
$start = $request->get("start_time");
|
||||
$end = $request->get("end_time");
|
||||
$dailyStockRecord = $build->when($start, function ($query) use ($start) {
|
||||
$query->where("created_at", ">=", $start);
|
||||
})->when($end, function ($query) use ($end) {
|
||||
$query->where("created_at", "<=", $end);
|
||||
})->orderByDesc("id")->paginate($request->get('per_page'));
|
||||
return JsonResource::collection($dailyStockRecord);
|
||||
}
|
||||
|
||||
@ -71,7 +77,7 @@ class DailyStockRecordController extends Controller
|
||||
];
|
||||
return response($this->res, $this->res['httpCode']);
|
||||
}
|
||||
$goodsSkuWithInventory = array_merge($goodsSku->toArray(),["inventory"=>$request->inventory]);
|
||||
$goodsSkuWithInventory = array_merge($goodsSku->toArray(), ["inventory" => $request->inventory]);
|
||||
//同批量逻辑操作
|
||||
$goodSkuService = new GoodSkuService();
|
||||
$goodSkuService->inventory([$goodsSkuWithInventory]);
|
||||
@ -94,7 +100,7 @@ class DailyStockRecordController extends Controller
|
||||
$this->setValidatorFailResponse($validator->getMessageBag()->getMessages());
|
||||
return response($this->res, $this->res['httpCode']);
|
||||
}
|
||||
$inventoryKeyByExternalSkuIdMap = collect($request->inventoryOrders)->pluck(null,"external_sku_id")->toArray();
|
||||
$inventoryKeyByExternalSkuIdMap = collect($request->inventoryOrders)->pluck(null, "external_sku_id")->toArray();
|
||||
$goodsSkus = GoodsSku::query()->with("combinationGoods")->whereIn('external_sku_id', array_keys($inventoryKeyByExternalSkuIdMap))
|
||||
->get()->toArray();
|
||||
$goodsSkus = collect($goodsSkus)->map(function ($v) use ($inventoryKeyByExternalSkuIdMap) {
|
||||
@ -103,7 +109,7 @@ class DailyStockRecordController extends Controller
|
||||
return $v;
|
||||
}
|
||||
})->toArray();
|
||||
Log::info("goodsSkus",$goodsSkus);
|
||||
Log::info("goodsSkus", $goodsSkus);
|
||||
$goodSkuService = new GoodSkuService();
|
||||
$goodSkuService->inventory($goodsSkus);
|
||||
return response($this->res, $this->res['httpCode']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user