feat: sku

This commit is contained in:
2025-02-11 10:31:43 +08:00
parent 387c01f91b
commit 0cdf5ee52d
4 changed files with 84 additions and 25 deletions

View File

@@ -286,4 +286,30 @@ class GoodCache
return $data;
}
/**
* @param int $kitchenId
* @param int $cycleId
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function delCache(int $kitchenId,int $cycleId)
{
$keyArr = [
ApiRedisKey::mealGoodListKey($cycleId,$kitchenId),
ApiRedisKey::optionalGoodListKey($cycleId,$kitchenId),
ApiRedisKey::goodStockKey($cycleId,$kitchenId)
];
$script = <<<LUA
local corpseCount = 0
for _, key in ipairs(KEYS) do
corpseCount = corpseCount + redis.call('DEL', key)
end
return corpseCount
LUA;
$this->redis->eval($script, $keyArr,count($keyArr));
}
}