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

@@ -90,7 +90,7 @@ class Sku extends Model
->whereIn('spu_id',$spuIds)
->where('is_del',GoodCode::SKU_IS_NO_DEL)
->where('saleable',GoodCode::LISTING)
->where('is_add_staple_food',GoodCode::IS_NOT_ADD_STAPLE_FOOD)
// ->where('is_add_staple_food',GoodCode::IS_NOT_ADD_STAPLE_FOOD)
->orderBy('sort')
->select(['id','spu_id','title','image_ids','price','param','extra','total_stock','surplus_stock','order_num','is_add_staple_food','occupied','chef_id'])
->get();

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]);
}
}