wugg 8 місяців тому
батько
коміт
b8a61cd9f0

+ 5 - 0
app/admin/controller/Sale.php

@@ -284,6 +284,7 @@ class Sale extends Base
                         $temp['spuCode']=$item['spuCode'];
                         $temp['tax_code']=$item['cat_code'];
                         $temp['tax_name']=$item['cat_name'];
+                        $temp['tax_short_name']=$item['short_name'];
                         $temp['inv_tax']=$item['tax'];
                         $temp['inv_good_name']=$item['inv_good_name'];
                         return $temp;
@@ -598,6 +599,7 @@ class Sale extends Base
                         $temp['spuCode']=$item['spuCode'];
                         $temp['tax_code']=$item['cat_code'];
                         $temp['tax_name']=$item['cat_name'];
+                        $temp['tax_short_name']=$item['short_name'];
                         $temp['inv_tax']=$item['tax'];
                         $temp['inv_good_name']=$item['inv_good_name'];
                         return $temp;
@@ -1239,6 +1241,7 @@ class Sale extends Base
                         $temp['spuCode']=$item['spuCode'];
                         $temp['tax_code']=$item['cat_code'];
                         $temp['tax_name']=$item['cat_name'];
+                         $temp['tax_short_name']=$item['short_name'];
                         $temp['inv_tax']=$item['tax'];
                         $temp['inv_good_name']=$item['inv_good_name'];
                         return $temp;
@@ -1836,6 +1839,7 @@ class Sale extends Base
                    $temp['spuCode']=$item['spuCode'];
                    $temp['tax_code']=$item['cat_code'];
                    $temp['tax_name']=$item['cat_name'];
+                    $temp['tax_short_name']=$item['short_name'];
                    $temp['inv_tax']=$item['tax'];
                    $temp['inv_good_name']=$item['inv_good_name'];
                    return $temp;
@@ -2120,6 +2124,7 @@ class Sale extends Base
                    $temp['spuCode']=$item['spuCode'];
                    $temp['tax_code']=$item['cat_code'];
                    $temp['tax_name']=$item['cat_name'];
+                    $temp['tax_short_name']=$item['short_name'];
                    $temp['inv_tax']=$item['tax'];
                    $temp['inv_good_name']=$item['inv_good_name'];
                    return $temp;

+ 4 - 2
app/admin/model/GoodTax.php

@@ -33,7 +33,8 @@ class GoodTax extends Model
         if($type==1){
              $temp['spuCode']=$item->spuCode;
              $temp['cat_code']=$item->merge_code;
-             $temp['cat_name']=$item->short_name;
+             $temp['cat_name']=$item->cat_name;
+             $temp['short_name']=$item->short_name;
              $temp['tax']= str_replace("%","",$item->tax);
              $temp['inv_good_name']=$item->inv_good_name;
         }else{
@@ -41,7 +42,8 @@ class GoodTax extends Model
              if($taxRelation->isEmpty())return [];
              $temp['spuCode']=$item->spuCode;
              $temp['cat_code']=$taxRelation->merge_code;
-             $temp['cat_name']=$taxRelation->short_name;
+             $temp['cat_name']=$item->cat_name;
+             $temp['short_name']=$item->short_name;
              $temp['tax']=str_replace('%','',$taxRelation->output_bind_tax);;
              $temp['inv_good_name']=$item->inv_good_name;
         }

+ 4 - 2
app/command/ImportOrderFromCHandleData.php

@@ -322,12 +322,13 @@ class ImportOrderFromCHandleData extends Command
                     }
             $taxInfo = OrderTax::SpuCat( $spuCode);
            if (!empty($taxInfo)) {
-              OrderTax::saveAll(array_map(function ($item)use($orderCode){
+              (new \app\admin\model\OrderTax)->saveAll(array_map(function ($item)use($orderCode){
                    $temp=[];
                    $temp['code']=$orderCode;
                    $temp['spuCode']=$item['spuCode'];
                    $temp['tax_code']=$item['cat_code'];
                    $temp['tax_name']=$item['cat_name'];
+                    $temp['tax_short_name']=$item['short_name'];
                    $temp['inv_tax']=$item['tax'];
                    $temp['inv_good_name']=$item['inv_good_name'];
                    return $temp;
@@ -589,12 +590,13 @@ class ImportOrderFromCHandleData extends Command
         if ($up) {
             $taxInfo = OrderTax::SpuCat( $data['spuCode'],1,1);
            if (!empty($taxInfo)) {
-              OrderTax::saveAll(array_map(function ($item)use($cgdCode){
+              (new \app\admin\model\OrderTax)->saveAll(array_map(function ($item)use($cgdCode){
                    $temp=[];
                    $temp['code']=$cgdCode;
                    $temp['spuCode']=$item['spuCode'];
                    $temp['tax_code']=$item['cat_code'];
                    $temp['tax_name']=$item['cat_name'];
+                    $temp['tax_short_name']=$item['short_name'];
                    $temp['inv_tax']=$item['tax'];
                    $temp['inv_good_name']=$item['inv_good_name'];
                    return $temp;

+ 4 - 2
app/command/handleYzOrderData.php

@@ -283,12 +283,13 @@ class handleYzOrderData extends Command
                     }
            $taxInfo = OrderTax::SpuCat( $spuCode);
            if (!empty($taxInfo)) {
-              OrderTax::saveAll(array_map(function ($item)use($orderCode){
+              (new \app\admin\model\OrderTax)->saveAll(array_map(function ($item)use($orderCode){
                    $temp=[];
                    $temp['code']=$orderCode;
                    $temp['spuCode']=$item['spuCode'];
                    $temp['tax_code']=$item['cat_code'];
                    $temp['tax_name']=$item['cat_name'];
+                   $temp['tax_short_name']=$item['short_name'];
                    $temp['inv_tax']=$item['tax'];
                    $temp['inv_good_name']=$item['inv_good_name'];
                    return $temp;
@@ -591,12 +592,13 @@ class handleYzOrderData extends Command
         if ($up) {
             $taxInfo = OrderTax::SpuCat( $data['spuCode'],1,1);
            if (!empty($taxInfo)) {
-              OrderTax::saveAll(array_map(function ($item)use($cgdCode){
+              (new \app\admin\model\OrderTax)->saveAll(array_map(function ($item)use($cgdCode){
                    $temp=[];
                    $temp['code']=$cgdCode;
                    $temp['spuCode']=$item['spuCode'];
                    $temp['tax_code']=$item['cat_code'];
                    $temp['tax_name']=$item['cat_name'];
+                   $temp['tax_short_name']=$item['short_name'];
                    $temp['inv_tax']=$item['tax'];
                    $temp['inv_good_name']=$item['inv_good_name'];
                    return $temp;