库存
This commit is contained in:
parent
12bfcb0241
commit
c1016e8382
@ -47,7 +47,9 @@ class BusinessOrderUpdateListener implements ShouldQueue
|
||||
if (!empty($event->goodsSku)) {
|
||||
//查询库存是否满足告警规则
|
||||
//查找昨日统计的库存数据
|
||||
$inventory = $event->goodsSku['yesterday_num'] ?? 0;
|
||||
$record = DailyStockRecord::query()->where('sku_id', $event->goodsSku->id)->where("inventory", '>', 0)->orderByDesc('day')->first();
|
||||
Log::info("库存告警record", [$record]);
|
||||
$inventory = $record->inventory ?? 0;
|
||||
$expireTime = Carbon::now()->addMinutes(30)->toDateTimeString();
|
||||
$proportion = Cache::remember(CacheKeyEnum::STOCK_RULE_PROPORTION, $expireTime, function () {
|
||||
$developerConfig = DeveloperConfig::query()->where("key", "=", DevConfigKeyEnum::STOCK_RULE_PROPORTION)->first();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user