Ver código fonte

Merge branch 'master' into zengjun

ajun 5 anos atrás
pai
commit
abe464862f

+ 9 - 0
app/Http/Controllers/TestController.php

@@ -482,6 +482,15 @@ class TestController extends Controller
     }
 
 
+    public function divide()
+    {
+        $trackings = OrderTracking::query()->with('commodities.package')->get();
+        $trackings->each(function ($tracking){
+            $tracking->each(function (){
+
+            });
+        });
+    }
     public function test3()
     {
 //        dd(bcmul(0.3,0.3,5));

+ 1 - 0
app/Services/OrderPackageService.php

@@ -452,6 +452,7 @@ class OrderPackageService
                 $bulk = bcmul($commodity['length'],$commodity['width'],5);
                 $bulk = bcmul($commodity['height'],$bulk,5);
                 $bulk = bcmul($bulk,$orderPackageCommodity->amount,5);
+                if($bulk>=1000)bcdiv($bulk,1000000000,3);
                 $params['bulk'] +=  $bulk;
             }
             if($params['bulk'] == $orderPackage->bulk && $orderPackage->bulk!= 0){continue;}

+ 2 - 8
public/t.php

@@ -1,9 +1,3 @@
-<script>
+<?php
 
-
-    let arr=[a:111,b:222]
-    arr['c']=333;
-    arr['c']=333;
-    arr['c']=333;
-    console.log(Array.isArray(arr['c']),Array.isArray(arr['cc']))
-</script>
+echo bcdiv(123456789,1000000000,3);

+ 5 - 5
resources/views/order/tracking/index.blade.php

@@ -444,11 +444,11 @@
             },
             filters:{
                 millimeterToCubic:function(val){
-                    console.log(val);
-                    if(typeof(val)==='undefined')return '';
-                    if(val==='0'||val===0)return 0;
-                    if(!val)return '';
-                    return _.round(val/1000000000,3);
+                    // if(typeof(val)==='undefined')return '';
+                    // if(val==='0'||val===0)return 0;
+                    // if(!val)return '';
+                    // return _.round(val/1000000000,3);
+                    return val;
                 },
                 dateTime:function(value) {
                     if (value !== null) {