MS-PDRLKVHCADMG\Administrator 5 年 前
コミット
da64ce0b96

+ 6 - 2
api/application/controllers/Lampcontrol.php

@@ -1239,7 +1239,7 @@ class Lampcontrol extends Base_Controller {
         }
         if ($datatype == 'lampinfo') {
 
-            $fields = "number,projectid,address,longitude,latitude,section,boardpower,lamptype,boardtype,batteryah,loadpower,devstatus,loadtype,supplier,upazilla,po,manu,protocoltype,updatetime,status";
+            $fields = "number,projectid,address,longitude,latitude,section,boardpower,lamptype,boardtype,batteryah,loadpower,devstatus,loadtype,supplier,upazilla,po,manu,protocoltype,updatetime,status,power,model,fascal_year,fascal_year_phase";
 
             $res = $this->Lamp_model->get_one(['id'=>$lamp_id],$fields);
             if (empty($res)) {
@@ -1310,7 +1310,11 @@ class Lampcontrol extends Base_Controller {
                 'po'=>intval($res['po']),
                 'manu'=>intval($res['manu']),
                 "updatetime" => $res["updatetime"], 
-                'loadtype' => $res['loadtype']
+                'loadtype' => $res['loadtype'],
+                'power' => $res['power'],
+                'model' => $res['model'],
+                'fascal_year' => $res['fascal_year'],
+                'fascal_year_phase' => $res['fascal_year_phase'],
             );
             // $msisdn = $this->db->query('select iccid from msisdn where imsi = "'.$res['simid'].'"')->row_array();
             // if (empty($msisdn) || empty($msisdn['iccid'])) {

+ 51 - 46
api/application/controllers/Project.php

@@ -115,36 +115,38 @@ class Project extends Base_Controller {
             $data['longitude'] = $res1['longitude'];
             $data['latitude'] = $res1['latitude'];
             $res2 = $this->Global_location_model->get_one(['id'=>$res1['pid']],'pid,chinese_name,english_name');
-            if ($res1['level'] == 4) {
+            $data['city'] = $res2['english_name'];
+            // if ($res1['level'] == 4) {
                 $data['areaId'] = $data['cityid'];
                 $data['cityId'] = $res1['pid'];
                 $data['provinceId'] = $res2['pid'];
                 $res3 = $this->Global_location_model->get_one(['id'=>$res2['pid']],'pid,chinese_name,english_name');
+                $data['province'] = $res3['english_name'];
                 $data['countryId'] = $res3['pid'];
                 $location_ch = $res3['chinese_name'].','.$res2['chinese_name'].','.$res1['chinese_name'];
                 $location_en = $res1['english_name'].','.$res2['english_name'].','.$res3['english_name'];
-            }elseif ($res1['level'] == 3) {
-                $data['areaId'] = 0;
-                $data['cityId'] = $data['cityid'];
-                $data['provinceId'] = $res1['pid'];
-                $data['countryId'] = $res2['pid'];
-                $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
-                $location_en = $res1['english_name'].','.$res2['english_name'];
-            }elseif ($res1['level'] == 2) {
-                $data['areaId'] = 0;
-                $data['cityId'] = 0;
-                $data['provinceId'] = $data['cityid'];
-                $data['countryId'] = $res1['pid'];
-                $location_ch = $res1['chinese_name'];
-                $location_en = $res1['english_name'];
-            }else{
-                $data['areaId'] = 0;
-                $data['cityId'] = 0;
-                $data['provinceId'] = 0;
-                $data['countryId'] = $data['cityid'];
-                $location_ch = $res1['chinese_name'];
-                $location_en = $res1['english_name'];
-            }
+            // }elseif ($res1['level'] == 3) {
+            //     $data['areaId'] = 0;
+            //     $data['cityId'] = $data['cityid'];
+            //     $data['provinceId'] = $res1['pid'];
+            //     $data['countryId'] = $res2['pid'];
+            //     $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
+            //     $location_en = $res1['english_name'].','.$res2['english_name'];
+            // }elseif ($res1['level'] == 2) {
+            //     $data['areaId'] = 0;
+            //     $data['cityId'] = 0;
+            //     $data['provinceId'] = $data['cityid'];
+            //     $data['countryId'] = $res1['pid'];
+            //     $location_ch = $res1['chinese_name'];
+            //     $location_en = $res1['english_name'];
+            // }else{
+            //     $data['areaId'] = 0;
+            //     $data['cityId'] = 0;
+            //     $data['provinceId'] = 0;
+            //     $data['countryId'] = $data['cityid'];
+            //     $location_ch = $res1['chinese_name'];
+            //     $location_en = $res1['english_name'];
+            // }
             $data['location'] = $location_en;
             $project_weather = $this->db->query('select * from project_weather where projectId = '.$project_id)->row_array();
             if (empty($project_weather) || time() - strtotime($project_weather['updatetime']) > 3600) {
@@ -573,39 +575,42 @@ class Project extends Base_Controller {
                 $location_en = 'There is no location information, please select location information on the edit project page.';
             }else{
                 $res1 = $this->Global_location_model->get_one(['id'=>$data['cityid']],'level,pid,chinese_name,longitude,latitude,english_name');
+                $data['area'] = $res1['english_name'];
                 $data['longitude'] = $res1['longitude'];
                 $data['latitude'] = $res1['latitude'];
                 $res2 = $this->Global_location_model->get_one(['id'=>$res1['pid']],'pid,chinese_name,english_name');
-                if ($res1['level'] == 4) {
+                $data['city'] = $res2['english_name'];
+                // if ($res1['level'] == 4) {
                     $data['areaId'] = $data['cityid'];
                     $data['cityId'] = $res1['pid'];
                     $data['provinceId'] = $res2['pid'];
                     $res3 = $this->Global_location_model->get_one(['id'=>$res2['pid']],'pid,chinese_name,english_name');
+                    $data['province'] = $res3['english_name'];
                     $data['countryId'] = $res3['pid'];
                     $location_ch = $res3['chinese_name'].','.$res2['chinese_name'].','.$res1['chinese_name'];
                     $location_en = $res1['english_name'].','.$res2['english_name'].','.$res3['english_name'];
-                }elseif ($res1['level'] == 3) {
-                    $data['areaId'] = 0;
-                    $data['cityId'] = $data['cityid'];
-                    $data['provinceId'] = $res1['pid'];
-                    $data['countryId'] = $res2['pid'];
-                    $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
-                    $location_en = $res1['english_name'].','.$res2['english_name'];
-                }elseif ($res1['level'] == 2) {
-                    $data['areaId'] = 0;
-                    $data['cityId'] = 0;
-                    $data['provinceId'] = $data['cityid'];
-                    $data['countryId'] = $res1['pid'];
-                    $location_ch = $res1['chinese_name'];
-                    $location_en = $res1['english_name'];
-                }else{
-                    $data['areaId'] = 0;
-                    $data['cityId'] = 0;
-                    $data['provinceId'] = 0;
-                    $data['countryId'] = $data['cityid'];
-                    $location_ch = $res1['chinese_name'];
-                    $location_en = $res1['english_name'];
-                }
+                // }elseif ($res1['level'] == 3) {
+                //     $data['areaId'] = 0;
+                //     $data['cityId'] = $data['cityid'];
+                //     $data['provinceId'] = $res1['pid'];
+                //     $data['countryId'] = $res2['pid'];
+                //     $location_ch = $res2['chinese_name'].','.$res1['chinese_name'];
+                //     $location_en = $res1['english_name'].','.$res2['english_name'];
+                // }elseif ($res1['level'] == 2) {
+                //     $data['areaId'] = 0;
+                //     $data['cityId'] = 0;
+                //     $data['provinceId'] = $data['cityid'];
+                //     $data['countryId'] = $res1['pid'];
+                //     $location_ch = $res1['chinese_name'];
+                //     $location_en = $res1['english_name'];
+                // }else{
+                //     $data['areaId'] = 0;
+                //     $data['cityId'] = 0;
+                //     $data['provinceId'] = 0;
+                //     $data['countryId'] = $data['cityid'];
+                //     $location_ch = $res1['chinese_name'];
+                //     $location_en = $res1['english_name'];
+                // }
             }
 
             $data['location'] = $location_en;