cqp 2 dias atrás
pai
commit
633ccae8ee
1 arquivos alterados com 19 adições e 0 exclusões
  1. 19 0
      app/Service/LargeScreenService.php

+ 19 - 0
app/Service/LargeScreenService.php

@@ -855,6 +855,20 @@ class LargeScreenService extends Service
             13 => 0.623,
         ];
 
+        $device_map2 = [
+            8 => 732,
+            9 => 730,
+            12 => 746,
+            13 => 720,
+        ];
+
+        $device_map3 = [
+            8 => 545,
+            9 => 550,
+            12 => 567,
+            13 => 560,
+        ];
+
         $orders = DeviceOrderInfo::from('device_order_info as a')
             ->join('device_order as b','a.device_order_id','b.id')
             ->where('a.type',3)
@@ -959,10 +973,15 @@ class LargeScreenService extends Service
             }
 
             $n = $device_map[$device_id] ?? 0;
+            $n2 = $device_map2[$device_id] ?? 0;
+            $n3 = $device_map3[$device_id] ?? 0;
             if($tmp['last_week_total'] >= 105) $tmp['last_week_total'] = bcmul(bcmul($n,24,4),7,2);
             $last_week_hour = bcmul(bcdiv($tmp['last_week_total'], 15,4),24,2);
             $last_month_hour = bcmul(bcdiv($tmp['last_month_total'], 15,4),24,2);
 
+            if($last_month_hour >= 760) $last_month_hour = $n2;
+            if($tmp['last_month_total'] >= 600) $tmp['last_month_total'] = $n3;
+
             $wx = $result_wx[$device_id] ?? [];
             $last_week_emergency = $wx['last_week'] ?? 0;
             $last_month_emergency = $wx['last_month'] ?? 0;