feat : spu

This commit is contained in:
2025-03-25 14:22:22 +08:00
parent bc7fc62450
commit a4e9b3d04b

View File

@@ -83,7 +83,7 @@ class CycleListService extends CateringBaseService
if (empty($spuList)) return $this->return->success('success',['list' => []]);
$spuList = $spuList->toArray();
$skuList = $this->skuModel->where('spu_id',array_column($spuList,'id'))->pluck('id','spu_id');
$skuList = $this->skuModel->whereIn('spu_id',array_column($spuList,'id'))->pluck('id','spu_id');
foreach ($spuList as &$v) {
$v['sku_id'] = $skuList[$v['id']] ?? 0;