Browse Source

checkflist接口补全商品单位字段

wufeng 2 years ago
parent
commit
9a6fefb1e2
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/admin/controller/Check.php

+ 2 - 0
app/admin/controller/Check.php

@@ -117,6 +117,7 @@ public function flist(){
 
         //品牌信息
         $brands = Db::name('brand')->whereIn('id', array_column($list, 'brand_id'))->where('is_del', 0)->column('brand_name', 'id');
+        $units = Db::name('unit')->whereIn('id', array_column($list, 'good_unit'))->where('is_del', 0)->column('unit', 'id');
 
         foreach ($list as $key=>$value){
             $supplier = Db::name("supplier")->where(["code"=>$value['supplierNo']])->find();
@@ -128,6 +129,7 @@ public function flist(){
             $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
 
             $value['brand_name'] = $brands[$value['brand_id']]??'';
+            $value['unit'] = $units[$value['good_unit']]??'';
 
             //规格信息
             $spec = Db::name("good_spec")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->select()->toArray();