DESKTOP-9JTA2JJ\HP 5 år sedan
förälder
incheckning
65751c17ad
1 ändrade filer med 11 tillägg och 10 borttagningar
  1. 11 10
      api/application/controllers/Lampcontrol.php

+ 11 - 10
api/application/controllers/Lampcontrol.php

@@ -683,6 +683,7 @@ class Lampcontrol extends Base_Controller {
             }elseif (strpos('light_time', $key)) {
                 $t = explode(':', $value);
                 $m = $t[0]*60+$t[1];
+                $m = round($m/10);
                 $word = substr('00'.base_convert($m, 10, 16), -2);
             }else{
                 $word = substr('00'.base_convert($value, 10, 16), -2);
@@ -999,9 +1000,9 @@ class Lampcontrol extends Base_Controller {
 
 
     private function format_date_en($date){
-        $h = floor($date/3600);
+        $h = floor($date/60);
         $h = $h > 10 ? $h : '0'.$h;
-        $t = floor($date%3600/60);
+        $t = floor($date%60);
         $t = $t > 10 ? $t : '0'.$t;
         return $h.':'.$t;
     }
@@ -1123,14 +1124,14 @@ class Lampcontrol extends Base_Controller {
         // $res['end_current'] = number_format($res['end_current'],2);
         // $res['end_voltage'] = number_format($res['end_voltage'],1);
         // $res['begin_voltage'] = number_format($res['begin_voltage'],1);
-        $res['first_light_time'] = $this->format_date_en($res['first_light_time']);
-        $res['second_light_time'] = $this->format_date_en($res['second_light_time']);
-        $res['third_light_time'] = $this->format_date_en($res['third_light_time']);
-        $res['fourth_light_time'] = $this->format_date_en($res['fourth_light_time']);
-        $res['fifth_light_time'] = $this->format_date_en($res['fifth_light_time']);
-        $res['sixth_light_time'] = $this->format_date_en($res['sixth_light_time']);
-        $res['seventh_light_time'] = $this->format_date_en($res['seventh_light_time']);
-        $res['tenth_light_time'] = $this->format_date_en($res['tenth_light_time']);
+        $res['first_light_time'] = $this->format_date_en($res['first_light_time']*10);
+        $res['second_light_time'] = $this->format_date_en($res['second_light_time']*10);
+        $res['third_light_time'] = $this->format_date_en($res['third_light_time']*10);
+        $res['fourth_light_time'] = $this->format_date_en($res['fourth_light_time']*10);
+        $res['fifth_light_time'] = $this->format_date_en($res['fifth_light_time']*10);
+        $res['sixth_light_time'] = $this->format_date_en($res['sixth_light_time']*10);
+        $res['seventh_light_time'] = $this->format_date_en($res['seventh_light_time']*10);
+        $res['tenth_light_time'] = $this->format_date_en($res['tenth_light_time']*10);
         // unset($res['id']);
         // unset($res['updatetime']);
         $data = $res;