Commit 7f2699d3 by 杨树贤

主营品牌数据顺序问题

parent dabed4af
Showing with 12 additions and 1 deletions
...@@ -72,10 +72,20 @@ class StandardBrandService ...@@ -72,10 +72,20 @@ class StandardBrandService
'standard_brand_id as brand_id', 'standard_brand_id as brand_id',
])->get(); ])->get();
$brands = !empty($brands) ? $brands->toArray() : []; $brands = !empty($brands) ? $brands->toArray() : [];
return array_map(function ($brand) { $brands = array_map(function ($brand) {
$brand['show_name'] = $brand['brand_name']; $brand['show_name'] = $brand['brand_name'];
$brand['mapping_brand_names'] = '-'; $brand['mapping_brand_names'] = '-';
return $brand; return $brand;
}, $brands); }, $brands);
//还要遵循原始排序
$result = [];
foreach ($brandIds as $brandId) {
foreach ($brands as $brand) {
if ($brandId == $brand['brand_id']) {
$result[] = $brand;
}
}
}
return $result ?: [];
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment