DESKTOP-9JTA2JJ\HP %!s(int64=5) %!d(string=hai) anos
pai
achega
b08a3b21ed
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      api/application/models/Lamp_model.php

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

@@ -866,12 +866,12 @@ class Lamp_model extends Base_model {
 		}
 
 		if ($nw_status !== false) {
-			$andCondition = 'AND N.status = '.$nw_status;
+			$andCondition = 'AND L.netstatus = '.$nw_status;
 		} else {
 			$andCondition = '';
 		}
 
-		$sql = "SELECT COUNT(L.id) AS num FROM lampinfo as L left join network as N on L.networkid = N.id WHERE {$condition} {$andCondition}";
+		$sql = "SELECT COUNT(L.id) AS num FROM lampinfo as L WHERE {$condition} {$andCondition}";
 		$query = $this->db->query($sql);
 		$arrRet = $query->row_array();
 		return $arrRet;