wesmiler %!s(int64=2) %!d(string=hai) anos
pai
achega
3a8be76689
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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);
             }