feat : spu
This commit is contained in:
@@ -83,7 +83,7 @@ class CycleListService extends CateringBaseService
|
|||||||
if (empty($spuList)) return $this->return->success('success',['list' => []]);
|
if (empty($spuList)) return $this->return->success('success',['list' => []]);
|
||||||
$spuList = $spuList->toArray();
|
$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) {
|
foreach ($spuList as &$v) {
|
||||||
$v['sku_id'] = $skuList[$v['id']] ?? 0;
|
$v['sku_id'] = $skuList[$v['id']] ?? 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user