hrjy 2 years ago
parent
commit
1ee62b27ec

+ 1 - 0
app/admin/controller/water/WaterMaterialScience.php

@@ -502,6 +502,7 @@ class WaterMaterialScience extends AuthController
                                     $details['long'] = $long;
                                     $details['wide'] = $wide;
                                     $details['name'] = $name;
+                                    $details['weight'] = $item[6];
                                     $details->save();
                                 }
                             }

+ 14 - 7
app/api/controller/water/WaterQueryController.php

@@ -159,7 +159,7 @@ class WaterQueryController
             $floor = $calculation['floor_number'];
             foreach ($science as $item) {
                 $m2 = $item['long'] * $item['wide'];
-                $floor1 = ceil($floor / $m2);
+                $floor1 = $floor / $m2;
                 $table[] = ['title' => '底板', 'name' => $item['name'], 'specifications' =>  $item['long'].'m*'.$item['wide'].'m', 'number' => $floor1, 'unit_price' => $item['unit_price'], 'company' => $item['company'], 'ot_price' => $item['unit_price'] * $floor1, 'weight' => $item['weight'] * $v, 'type' => 4];
             }
         }else {
@@ -168,12 +168,14 @@ class WaterQueryController
                 if ($floor > 0) {
                     $m2 = $item['long'] * $item['wide'];
                     if ($floor >= $m2) {
-                        $floor1 = intval($floor / $m2);
-                        $floor = $floor - ($m2 * $floor1);
-                        if ($floor < 0.5 and $floor > 0) {
-                            $floor1 += 1;
-                            $floor = 0;
-                        }
+//                        $floor1 = intval($floor / $m2);
+                        $floor1 = $floor / $m2;
+                        $floor = 0;
+//                        $floor = $floor - ($m2 * $floor1);
+//                        if ($floor < 0.5 and $floor > 0) {
+//                            $floor1 += 0.5;
+//                            $floor = 0;
+//                        }
                         $zj +=  $item['unit_price'] * $floor1;
                         $zzl += $item['weight'] * $v;
                         $table[] = ['title' => '底板', 'name' => $item['name'], 'specifications' =>  $item['long'].'m*'.$item['wide'].'m', 'number' => $floor1, 'unit_price' => $item['unit_price'], 'company' => $item['company'], 'ot_price' => $item['unit_price'] * $floor1, 'weight' => $item['weight'] * $v, 'type' => 4];
@@ -281,6 +283,11 @@ class WaterQueryController
             $i['ot_price'] = round($i['ot_price'], 2);
             $i['weight'] = round($i['weight'], 2);
         }
+        if ($data['is_warm']){
+            $zj += 169;
+        }else{
+            $zj += 105;
+        }
         if ($discount > 0){
             foreach ($table as &$item)
             {