Browse Source

商品统计接口中,一级分类转变成字符串

wufeng 2 years ago
parent
commit
094b96f344
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/admin/controller/Good.php

+ 1 - 0
app/admin/controller/Good.php

@@ -501,6 +501,7 @@ class Good extends Base
             $unit = Db::name("unit")->where(['id'=>$value['good_unit']])->find();
             $temp['unit'] = isset($unit['unit'])?$unit['unit']:"";
             $temp['sort_f']=isset($value['cat_id'])?made($value['cat_id']):[];
+            $temp['sort_f']=implode('/',array_column($temp['sort_f'],'name'));//由于这个字段原样在页面显示,所以在这里特意拼接成字符串
             $temp['attribute']=$value['craft_desc'];
             $temp['addtime']=$value['addtime'];
             $temp['usable_stock'] = isset($value['usable_stock'])? $value['usable_stock']:"";