wugg 7 місяців тому
батько
коміт
f2b33bfb22

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

@@ -398,16 +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']:"";
-         $taxInfo=[];
-        if($data['open_type']==1){
-            $taxInfo=GoodTax::with(['tax'])->where(['spuCode'=>$good_platform['spuCode']])->findOrEmpty();
-        }
-        $data['tax_id'] = $taxInfo['tax_id']??'';
-        $data['tax_name'] = $taxInfo['cat_name']??'';
-        $data['tax_short_name'] =$taxInfo['short_name']??'';
-        $data['tax_code'] =$taxInfo['merge_code']??'';
-        $data['tax']=$taxInfo['tax']??'';
-        $data['inv_good_name']=$taxInfo['inv_good_name']??'';
+        $data['tax_info']=GoodTax::with(['Tax','OutTax'])->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']=[];

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

@@ -1477,16 +1477,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');
         }
-        $taxInfo=[];
-        if($data['open_type']==1){
-          $taxInfo=GoodTax::getInfobySpuCode( $supcode,1);
-        }
-        $data['tax_id'] = $taxInfo['tax_id']??'';
-        $data['tax_name'] = $taxInfo['cat_name']??'';
-        $data['tax_short_name'] =$taxInfo['short_name']??"";
-        $data['tax_code'] =$taxInfo['merge_code']??"";
-        $data['tax']=$taxInfo['tax']??'';
-        $data["inv_good_name"]=$taxInfo['inv_good_name']??"";
+        $data['tax_info']=GoodTax::with(['Tax','OutTax'])->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();

+ 2 - 1
app/admin/controller/Sale.php

@@ -4739,7 +4739,8 @@ class Sale extends Base
             $price = Db::name("gold_price1")->where(["type" => $order['noble_metal'], "status" => 1, "is_del" => 0])->order("addtime desc")->find();
 
         }
-			$depart = get_company_name_by_uid($order['order_createrid']);
+        $order['tax_info']=GoodTax::with(['Tax','OutTax'])->where(['spuCode'=>$orderCode])->findOrEmpty();
+		$depart = get_company_name_by_uid($order['order_createrid']);
         $userCommon = \app\admin\common\User::getIns();
         $supplier = $userCommon->handle('sInfo',['code'=>$order['supplierNo']]);
 //        $supplier = Db::name("supplier")->where(["code" => $order['supplierNo']])->find();

+ 1 - 7
app/youzan/logic/Goodup.php

@@ -588,13 +588,7 @@ class Goodup
         $ladder = Db::name("good_ladder")->where(['skuCode' => $data['skuCode'], "is_del" => 0])->select()->toArray();
         $data["ladderlist"] = !empty($ladder) ? $ladder : [];
         $nakelist = Db::name("good_nake")->where(['spuCode' => $data['spuCode'], "is_del" => 0])->select()->toArray();
-        $taxInfo=GoodTax::with(['tax'])->where(['spuCode'=>$data['spuCode']])->findOrEmpty();
-        $data['tax_id'] = $taxInfo['tax_id']??'';
-        $data['tax_name'] = $taxInfo['cat_name']??'';
-        $data['tax_short_name'] =$taxInfo['short_name']??'';
-        $data['tax_code'] =$taxInfo['merge_code']??'';
-        $data['tax']=$taxInfo['tax']??'';
-        $data['inv_good_name']=$taxInfo['inv_good_name']??'';
+        $data['tax_info']=GoodTax::with(['Tax','OutTax'])->where(['spuCode'=>$data['spuCode']])->findOrEmpty();
         $gold_price = 0;
         if ($data['is_gold_price'] == 1 && $data['cost_fee'] != 0 && $data['good_price'] == 0) {
             $gold_price = Db::name("gold_price1")->where(["type" => $data['noble_metal'], "status" => 1, "is_del" => 0])->order("addtime desc")->value('price', 0);