瀏覽代碼

Merge branch 'master' of http://gogs.weclouds.xyz:3000/crazycat/IDCOL

XAWDJ0277HWXPT2\Administrator 5 年之前
父節點
當前提交
c91de17f71

+ 0 - 4
api/application/controllers/Home.php

@@ -85,10 +85,6 @@ class Home extends Base_Controller {
             array('name'=>'纬度','field'=>'L.latitude','fields1'=>'latitude','enname'=>'Latitude'),
             array('name'=>'sim卡号','field'=>'N.simid','fields1'=>'simid','enname'=>'SIM card number'),
             array('name'=>'套餐剩余','field'=>'N.packageSurplus','fields1'=>'packageSurplus','enname'=>'Package surplus'),
-            array('name'=>'灯杆高度(m)','field'=>'L.poleheight','fields1'=>'poleheight','enname'=>'Lamp-post length(m)'),
-            array('name'=>'灯杆直径(m)','field'=>'L.polediameter','fields1'=>'polediameter','enname'=>'Lamp-post diameter(m)'),
-            array('name'=>'灯杆材质','field'=>'L.polematerial','fields1'=>'polematerial','enname'=>'Lamp-post materials'),
-            array('name'=>'灯具类型','field'=>'L.lighttype','fields1'=>'lighttype','enname'=>'Light type'),
             array('name'=>'路灯类型','field'=>'L.lamptype','fields1'=>'lamptype','enname'=>'Lamp type'),
             array('name'=>'太阳能板类型','field'=>'L.boardtype','fields1'=>'boardtype','enname'=>'Solar panel type'),
             array('name'=>'太阳能板功率(W)','field'=>'L.boardpower','fields1'=>'boardpower','enname'=>'Solar panel power(W)'),

文件差異過大導致無法顯示
+ 2 - 49
api/application/controllers/Lampcontrol.php


+ 4 - 4
api/application/controllers/Project.php

@@ -405,8 +405,8 @@ class Project extends Base_Controller {
                 $sectionList = $this->Lamp_model->get_list(['projectid'=>$projectIdArr], 'section as name,projectid',NULL, NULL, 'convert(section using gbk) asc', 'projectid,section');
                 foreach ($sectionList as $key => $value) {
                     if (isset($temp[$value['projectid']])) {
-                        $temp[$value['projectid']]['sectionList'][] = $value;
-                        // unset($value['projectid']);
+                        unset($value['projectid']);
+                        $temp[$sectionList[$key]['projectid']]['sectionList'][] = $value;
                     }
                 }
                 $data = array_values($temp);
@@ -451,14 +451,14 @@ class Project extends Base_Controller {
                 foreach ($sectionList as $key => $value) {
                     if (isset($temp[$value['projectid']])) {
                         unset($value['projectid']);
-                        $temp[$value['projectid']]['sectionList'][] = $value;
+                        $temp[$sectionList[$key]['projectid']]['sectionList'][] = $value;
                     }
                 }
                 $temp = array_values($temp);
                 foreach ($temp as $key => $value) {
                     if (isset($temp2[$value['company']])) {
                         unset($value['company']);
-                        $temp[$value['company']]['projectList'][] = $value;
+                        $temp[$temp[$key]['company']]['projectList'][] = $value;
                     }
                 }
                 $data = array_values($temp2);

+ 49 - 0
api/application/helpers/function_helper.php

@@ -487,6 +487,55 @@ function get_time_by_timezone($timezone){
     return date('Y-m-d H:i:s',$time + $timezone*3600);
 }
 
+// 给定时间、时区计算目标时区时间
+function date_change($date,$start,$end){
+    $H = intval(date('H',strtotime($date)));
+    $d = intval(date('d',strtotime($date)));
+    $m = intval(date('m',strtotime($date)));
+    $Y = intval(date('Y',strtotime($date)));
+
+    if ($m <= 1) {
+        $beginDateMonth = date(($Y-1).'-12-01', strtotime($date));
+    }else{
+        $beginDateMonth = date($Y.'-'.($m-1).'-01', strtotime($date));
+    }
+    $day = intval(date('d', strtotime("$beginDateMonth +1 month -1 day"))); 
+    $day1 = intval(date('d', strtotime(date('Y-m-01',strtotime($date))." +1 month -1 day"))); 
+
+    $H1 = $H-($start - $end);
+    if ($H1 < 0) {
+        $H1 += 24;
+        if ($d <= 1) {
+            $d = $day;
+            if ($m <= 1) {
+                $Y -= 1;
+                $m = 12;
+            }else{
+                $m -= 1;
+            }
+        }else{
+            $d -= 1;
+        }
+    }elseif ($H1 >= 24) {
+        $H1 -= 24;
+        if ($d >= $day1) {
+            $d = 1;
+            if ($m >= 12) {
+                $m = 1;
+                $Y += 1;
+            }else{
+                $m += 1;
+            }
+        }else{
+            $d += 1;
+        }
+    }
+    if ($m < 10) $m = '0'.$m;
+    if ($d < 10) $d = '0'.$d;
+    if ($H1 < 10) $H1 = '0'.$H1;
+    return date("{$Y}-{$m}-{$d} {$H1}:i:s",strtotime($date));
+}
+
 // 文件下载
 function file_download($filePath){
     $file_name = basename($filePath);     //下载文件名