|
@@ -74,7 +74,19 @@ class GoodsService extends BaseService
|
|
|
"en_name" => $m->spec->en_name,
|
|
|
];
|
|
|
}),
|
|
|
- "custom" => $goods->custom,
|
|
|
+ "custom" => array_map(function ($custom) {
|
|
|
+ return [
|
|
|
+ "id" => $custom['id'],
|
|
|
+ "title" => $custom['title'] ?? "",
|
|
|
+ "en_title" => $custom['en_title'] ?? "",
|
|
|
+ "attr" => array_filter(array_values(array_map(function ($attr) {
|
|
|
+ if (is_null($attr['value'])) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return $attr;
|
|
|
+ }, $custom['attr']))),
|
|
|
+ ];
|
|
|
+ }, $goods->custom),
|
|
|
];
|
|
|
|
|
|
}
|