DESKTOP-9JTA2JJ\HP 5 gadi atpakaļ
vecāks
revīzija
0318f6e00a

+ 6 - 6
api/application/controllers/Report.php

@@ -221,7 +221,7 @@ class Report extends Base_Controller {
             $endDate = date('Y-m-d 23:59:59', strtotime(date('Y-12-01 00:00:00',strtotime($date))." +1 month -1 day"));
         }
         $item_ids_arr = explode(",", $item_ids);
-        $list = $this->Lamp_model->get_list_in('L.id', $item_ids_arr, 'L.id as id, L.number as name,N.networkname,P.projectname, L.createtime,L.section'); 
+        $list = $this->Lamp_model->get_list_in('L.id', $item_ids_arr, 'L.id as id, L.number as name,P.projectname, L.createtime,L.section'); 
         $temp = array();
         foreach ($list as $lamp) {
             $lamp['list'] = array();
@@ -249,7 +249,7 @@ class Report extends Base_Controller {
                         $d['id'] = $temp[$d['lampid']]['id'];
                         $d['number'] = $temp[$d['lampid']]['name'];
                         $d['projectname'] = $temp[$d['lampid']]['projectname'];
-                        $d['networkname'] = $temp[$d['lampid']]['networkname'];
+                        // $d['networkname'] = $temp[$d['lampid']]['networkname'];
                         $d['section'] = $temp[$d['lampid']]['section'];
                         $temp2[] = $d;
                         if ($date_type == 'month') {
@@ -283,7 +283,7 @@ class Report extends Base_Controller {
                         $d['id'] = $temp[$d['lampid']]['id'];
                         $d['number'] = $temp[$d['lampid']]['name'];
                         $d['projectname'] = $temp[$d['lampid']]['projectname'];
-                        $d['networkname'] = $temp[$d['lampid']]['networkname'];
+                        // $d['networkname'] = $temp[$d['lampid']]['networkname'];
                         $d['section'] = $temp[$d['lampid']]['section'];
                         $temp2[] = $d;
                         if ($date_type == 'month') {
@@ -317,7 +317,7 @@ class Report extends Base_Controller {
                         $d['id'] = $temp[$d['lampid']]['id'];
                         $d['number'] = $temp[$d['lampid']]['name'];
                         $d['projectname'] = $temp[$d['lampid']]['projectname'];
-                        $d['networkname'] = $temp[$d['lampid']]['networkname'];
+                        // $d['networkname'] = $temp[$d['lampid']]['networkname'];
                         $d['section'] = $temp[$d['lampid']]['section'];
                         $temp2[] = $d;
                         if ($date_type == 'month') {
@@ -351,7 +351,7 @@ class Report extends Base_Controller {
                         $d['id'] = $temp[$d['lampid']]['id'];
                         $d['number'] = $temp[$d['lampid']]['name'];
                         $d['projectname'] = $temp[$d['lampid']]['projectname'];
-                        $d['networkname'] = $temp[$d['lampid']]['networkname'];
+                        // $d['networkname'] = $temp[$d['lampid']]['networkname'];
                         $d['section'] = $temp[$d['lampid']]['section'];
                         $temp2[] = $d;
                         if ($date_type == 'month') {
@@ -385,7 +385,7 @@ class Report extends Base_Controller {
                         $d['id'] = $temp[$d['lampid']]['id'];
                         $d['number'] = $temp[$d['lampid']]['name'];
                         $d['projectname'] = $temp[$d['lampid']]['projectname'];
-                        $d['networkname'] = $temp[$d['lampid']]['networkname'];
+                        // $d['networkname'] = $temp[$d['lampid']]['networkname'];
                         $d['section'] = $temp[$d['lampid']]['section'];
                         $temp2[] = $d;
                         if ($date_type == 'month') {

+ 3 - 3
api/application/models/Lamp_model.php

@@ -37,10 +37,10 @@ class Lamp_model extends Base_model {
 		}
 
 		if(isset($filter['offline']) && !empty($filter['offline'])){
-			$this->db->where('N.status', 0);
+			$this->db->where('L.netstatus', 0);
 		}
 		if(isset($filter['online']) && !empty($filter['online'])){
-			$this->db->where('N.status', 1);
+			$this->db->where('L.netstatus', 1);
 		}
 		if(isset($filter['section']) && !empty($filter['section'])){
 			$this->db->where('L.section', $filter['section']);
@@ -119,7 +119,7 @@ class Lamp_model extends Base_model {
 	        // $this->db->join('(select t1.* from electric_info_log t1, (select lampid, max(updatetime) as maxtime from electric_info_log group by lampid) t2 where t1.lampid = t2.lampid and t1.updatetime = t2.maxtime) as EI', 'L.id = EI.lampid', 'left');
 	        // $this->db->join('(select t1.* from system_info_log t1, (select lampid, max(updatetime) as maxtime from system_info_log group by lampid) t2 where t1.lampid = t2.lampid and t1.updatetime = t2.maxtime) as SIL', 'L.id = SIL.lampid', 'left');
 	        $this->db->join('project as P', 'L.projectid = P.id', 'left');
-			$this->db->join('network as N', 'L.networkid = N.id', 'left');
+			// $this->db->join('network as N', 'L.networkid = N.id', 'left');
 			$this->db->join('msisdn as M', 'N.simid = M.imsi', 'left');
 	        // $this->db->join('(select lampid,max(updatetime) as time from history_info_log group by lampid) as T', 'L.id = T.lampid', 'left');
 	        // $this->db->join('lamp_info_log as LI', 'L.id = LI.lampid AND LI.lampid=T.lampid AND LI.updatetime = T.time', 'left');