Compare commits
2 Commits
20250724-0
...
20250724-0
| Author | SHA1 | Date | |
|---|---|---|---|
| 66666f4a3a | |||
| bbcc0d054f |
@@ -88,6 +88,7 @@ class SpuService extends BaseService
|
|||||||
if (empty($list['data'])) return $this->return->success('success', ['list' => $list]);
|
if (empty($list['data'])) return $this->return->success('success', ['list' => $list]);
|
||||||
|
|
||||||
$spuIds = array_column($list['data'], 'id');
|
$spuIds = array_column($list['data'], 'id');
|
||||||
|
$spuImageIds = array_column($list['data'], 'image_id');
|
||||||
|
|
||||||
$skuList = $this->skuModel
|
$skuList = $this->skuModel
|
||||||
->whereIn('spu_id',$spuIds)
|
->whereIn('spu_id',$spuIds)
|
||||||
@@ -99,7 +100,7 @@ class SpuService extends BaseService
|
|||||||
|
|
||||||
$imageIdArr = array_column($skuList,'image_ids');
|
$imageIdArr = array_column($skuList,'image_ids');
|
||||||
$imageIds = array_unique(explode(',',implode(',',$imageIdArr)));
|
$imageIds = array_unique(explode(',',implode(',',$imageIdArr)));
|
||||||
$imageList = $this->getOssObjects($imageIds);
|
$imageList = $this->getOssObjects(array_merge($imageIds,$spuImageIds));
|
||||||
|
|
||||||
$skuListArr = [];
|
$skuListArr = [];
|
||||||
foreach ($skuList as $sku) {
|
foreach ($skuList as $sku) {
|
||||||
@@ -126,6 +127,7 @@ class SpuService extends BaseService
|
|||||||
|
|
||||||
foreach ($list['data'] as &$item) {
|
foreach ($list['data'] as &$item) {
|
||||||
$item['sku_list'] = $skuListArr[$item['id']] ?? [];
|
$item['sku_list'] = $skuListArr[$item['id']] ?? [];
|
||||||
|
$item['image_url'] = $imageList[$item['image_id']] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->return->success('success', ['list' => $list]);
|
return $this->return->success('success', ['list' => $list]);
|
||||||
@@ -323,6 +325,7 @@ class SpuService extends BaseService
|
|||||||
$info['city_name'] = $this->systemCityModel->getCityNameById((int)$info['city_id']);
|
$info['city_name'] = $this->systemCityModel->getCityNameById((int)$info['city_id']);
|
||||||
$info['kitchen_name'] = $this->kitchenModel->getNameById((int)$info['kitchen_id']);
|
$info['kitchen_name'] = $this->kitchenModel->getNameById((int)$info['kitchen_id']);
|
||||||
// $info['chef_name'] = $this->chefModel->getChineseNameById((int)$info['chef_id']);
|
// $info['chef_name'] = $this->chefModel->getChineseNameById((int)$info['chef_id']);
|
||||||
|
$info['image_url'] = $this->getOssObjectById((int)$info['image_id']) ?? '';
|
||||||
$info['chef_name'] = '';
|
$info['chef_name'] = '';
|
||||||
$info['category_name'] = $this->categoryModel->getNameById((int)$info['category_id']);
|
$info['category_name'] = $this->categoryModel->getNameById((int)$info['category_id']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user