cqp 1 day ago
parent
commit
96ebe2c60a
1 changed files with 6 additions and 3 deletions
  1. 6 3
      app/Service/LargeScreenService.php

+ 6 - 3
app/Service/LargeScreenService.php

@@ -846,7 +846,7 @@ class LargeScreenService extends Service
             }
         }
 
-        $oee = $this->deviceZl($today_data,$todayStart,$todayEnd);
+//        $oee = $this->deviceZl($today_data,$todayStart,$todayEnd);
         $result = [];
         $device_map = [
             8 => 0.618,
@@ -957,8 +957,11 @@ class LargeScreenService extends Service
                 $total_today = 0;
                 $today_emergency = 0;
             }
-            $last_week_hour = round($lastWeekHours, 2);
-            $last_month_hour = round($lastMonthHours, 2);
+
+            $n = $device_map[$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);
 
             $wx = $result_wx[$device_id] ?? [];
             $last_week_emergency = $wx['last_week'] ?? 0;