wugg 7 months ago
parent
commit
9a72deaff9
2 changed files with 4 additions and 9 deletions
  1. 3 8
      app/admin/controller/Good.php
  2. 1 1
      app/admin/controller/Goodup.php

+ 3 - 8
app/admin/controller/Good.php

@@ -398,7 +398,7 @@ class Good extends Base
         $supplier = $userCommon->handle('sInfo',['code'=>$data['supplierNo']]);
         $data['supplierName'] = $names['data'][$data['supplierNo']]??'';//isset($supplier['name'])?$supplier['name']:"";
         $data['company'] = $names['data'][$data['companyNo']]??'';//isset($company['company'])?$company['company']:"";
-        $data['tax_info']=GoodTax::with(['Tax','OutTax'])->where(['spuCode'=>$good_platform['spuCode']])->findOrEmpty();
+        $data['tax_info']=GoodTax::with(['Tax','OutTax',"CgdTax"])->where(['spuCode'=>$good_platform['spuCode']])->findOrEmpty();
         $data['noble_name']=isset($data['noble_metal'])&&$data['noble_metal']!=0?$this->noble[$data['noble_metal']] :"";
         $data['combind_list']=[];
         $data['wsm_list']=[];
@@ -407,13 +407,8 @@ class Good extends Base
         	$data['combind_list'] = (new GoodCombind())->where(['spuCode'=>$good_platform['spuCode'],'is_del'=>0])->select()->toArray();
         	foreach ($data['combind_list'] as &$item){
         		$item['stock'] =bcmul($item['child_num'],$data['usable_stock']);
-        		$taxInfo=GoodTax::with(['tax'])->where(['spuCode'=>$item['childCode']])->findOrEmpty();
-        		$item['tax_id'] = $taxInfo['tax_id']??'';
-                $item['tax_name'] = $taxInfo['cat_name']??'';
-                $item['tax_short_name'] =$taxInfo['short_name']??'';
-                $item['tax_code'] =$taxInfo['merge_code']??'';
-                $item['tax']=$taxInfo['tax']??'';
-                $item['inv_good_name']=$taxInfo['inv_good_name']??'';
+        		$taxInfo=GoodTax::with(['Tax','OutTax','CgdTax'])->where(['spuCode'=>$item['childCode']])->findOrEmpty();
+        		$item['tax_info'] = $taxInfo;
         	}
         	  $data['wsm_list']=(new GoodStock())->withJoin(['wsminfo'] , 'left')
 	                                           ->where(['spuCode'=>$good_platform['spuCode'] , 'wsm_type'=>[2 , 5]])

+ 1 - 1
app/admin/controller/Goodup.php

@@ -1479,7 +1479,7 @@ class Goodup extends Base
 	                                           ->where(['spuCode'=>$supcode , 'wsm_type'=>[2 , 5]])
 	                                           ->column('good_stock.id stock_id,name,good_stock.wsm_code,usable_stock');
         }
-        $data['tax_info']=GoodTax::with(['Tax','OutTax'])->where(['spuCode'=>$supcode])->findOrEmpty();
+        $data['tax_info']=GoodTax::with(['Tax','OutTax',"CgdTax"])->where(['spuCode'=>$supcode])->findOrEmpty();
         $data['field_change'] = $data['field_change']!=''?json_decode($data['field_change']):"";
         if($data['brand_id']!=0){
             $brand=Db::name("brand")->where(["id"=>$data['brand_id']])->find();