Ver código fonte

修复:即时账单生成:箱规不存在,承运商不存在

Zhouzhendong 5 anos atrás
pai
commit
a1cc2ca235

+ 4 - 2
app/Http/Controllers/TestController.php

@@ -167,8 +167,10 @@ class TestController extends Controller
 
     public function test()
     {
-        dd(json_encode(false));
-        return view("test");
+        Cache::flush();
+        $service = new OrderService();
+        $order = Order::query()->find(2748314);
+        dd($service->createInstantBill($order));
     }
     public function a(int $c)
     {

+ 2 - 1
app/Services/OrderService.php

@@ -1284,8 +1284,9 @@ sql
         $logistic_fee = 0;
         $volume = 0;
         $weight = 0;
+        $isBunched = false;
         if (!$order->logistic || $order->logistic->type != "快递")$logistic_fee = null;
-        $isBunched = $order->logistic->is_bunched=='Y';
+        else $isBunched = $order->logistic->is_bunched=='Y';
         $weightExceptionMark = false;
         $provinceId = null;
         $taxFee = 0;

+ 2 - 2
app/Services/OwnerPriceOperationService.php

@@ -369,8 +369,8 @@ class OwnerPriceOperationService
     private function changeUnit($ownerId,$commodity)
     {
         if (!$commodity)return -4;
-        if ($commodity->pack_spec)return $commodity->pack_spec;
-        $pack = app("CommodityService")->getPack($ownerId,$commodity->sku);
+        if ($commodity["pack_spec"])return $commodity["pack_spec"];
+        $pack = app("CommodityService")->getPack($ownerId,$commodity["sku"]);
         if (!$pack)return -6;
         return $pack;
     }