wesmiler 2 лет назад
Родитель
Сommit
3a8be76689
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      app/Services/Api/GoodsService.php

+ 3 - 0
app/Services/Api/GoodsService.php

@@ -191,6 +191,9 @@ class GoodsService extends BaseService
                     $v['attr'] = $v['attr']? json_decode($v['attr'], true) : [];
                     $v['main_img'] = $v['main_img']? get_image_url($v['main_img']) : '';
                     $v['cost_prict'] =  $v['retail_price']? moneyFormat($v['retail_price']/$usdtPrice * $xdPrice,2) : $info['cost_price'];
+                    if($v['attr']){
+                        $v['attr_name'] = $v['attr'][0]['name'];
+                    }
                 }
                 unset($v);
             }