feat : chef name

This commit is contained in:
2025-04-10 15:59:00 +08:00
parent a420986739
commit a8523ed797
2 changed files with 5 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ use App\Cache\Redis\Api\ApiRedisKey;
use App\Cache\Redis\Api\GoodCache;
use App\Cache\Redis\Api\SiteCache;
use App\Cache\Redis\RedisCache;
use App\Constants\Common\GoodCode;
use App\Service\Api\BaseService;
use App\Service\ServiceTrait\Common\CycleTrait;
use Hyperf\Di\Annotation\Inject;
@@ -66,8 +67,10 @@ class MealListService extends BaseService
$stockKey = ApiRedisKey::goodStockKey((int)$cycleId,(int)$siteInfo['kitchen_id']);
foreach ($data as &$item) {
foreach ($item['sku_list'] as &$v) {
foreach ($item['sku_list'] as $skuKey => &$v) {
$v['surplus_stock'] = $this->redisCache->zScore($stockKey,$v['id']) ?? 0;
if ($v['is_add_staple_food'] == GoodCode::IS_ADD_STAPLE_FOOD) unset($item['sku_list'][$skuKey]);
}
}