cqpCow 2 ani în urmă
părinte
comite
ef2052b8c5

+ 3 - 2
app/Http/Controllers/Api/ScreenController.php

@@ -217,6 +217,7 @@ class ScreenController extends BaseController
         $data = $model->where('del_time',0)
             ->where('status',2)
             ->select('finished_time')
+            ->orderBy('finished_time','desc')
             ->get()->toArray();
 
         $return = [];
@@ -232,7 +233,7 @@ class ScreenController extends BaseController
         }
         $maxValue = empty($return) ? 0 : max($return);
         $today = $return[$date] ?? 0;
-        $rate = $maxValue ? intval($today/$maxValue) : 0;
+        $rate = $maxValue ? intval($today/$maxValue * 100) : 0;
         //工序-----------------------------
 
         //包装-----------------------------
@@ -254,7 +255,7 @@ class ScreenController extends BaseController
         }
         $maxValue = empty($return) ? 0 : max($return);
         $today = $return[$date] ?? 0;
-        $rate2 = $maxValue ? intval($today/$maxValue) : 0;
+        $rate2 = $maxValue ? intval($today/$maxValue*100) : 0;
         //包装-----------------------------
 
         $arr = [

+ 1 - 1
app/Service/ReportFormsService.php

@@ -89,7 +89,7 @@ class ReportFormsService extends Service
             $detail_key = $value['production_no'] . "|";
             foreach ($detail as $key_son => $value_son) {
                 if (strpos($key_son,$detail_key) !== false) {
-                    $value_son['rate'] = number_format($value_son['finish_count'] / $value['order_quantity'], 2);
+                    $value_son['rate'] = number_format($value_son['finish_count'] / $value['order_quantity'] * 100, 2);
                     $list[$key]['process'][] = $value_son;
                 }
             }