- Timestamp:
- Feb 3, 2016, 10:57:54 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r785 r793 56 56 TimeToMysqlDateTime($StartTime).'", NULL)'); 57 57 // Update previous record duration in UpDown table 58 $ System->Database->query('UPDATE `NetworkInterfaceUpDown` AS `TM` SET `Duration` = TIMESTAMPDIFF(SECOND, '.58 $this->Database->query('UPDATE `NetworkInterfaceUpDown` AS `TM` SET `Duration` = TIMESTAMPDIFF(SECOND, '. 59 59 '`TM`.`Time`, (SELECT `Time` FROM (SELECT * FROM `NetworkInterfaceUpDown`) AS `TA` WHERE (`TA`.`Time` > `TM`.`Time`) '. 60 60 'AND (`TA`.`Interface`=`TM`.`Interface`) ORDER BY `TA`.`Time` ASC LIMIT 1)) '. 61 61 'WHERE (`TM`.`Duration` IS NULL) AND (`TM`.`Interface` ='.$Interface['Id'].')'); 62 $ System->Database->update('NetworkInterface', '`Id` = "'.$Interface['Id'].'"',62 $this->Database->update('NetworkInterface', '`Id` = "'.$Interface['Id'].'"', 63 63 array('Online' => $Interface['NewOnline'])); 64 64 } … … 84 84 { 85 85 if($Device['SumOnline'] > 0) 86 $ System->Database->update('NetworkDevice', 'Id='.$Device['Device'], array('LastOnline' => TimeToMysqlDateTime($StartTime), 'Online' => 1));86 $this->Database->update('NetworkDevice', 'Id='.$Device['Device'], array('LastOnline' => TimeToMysqlDateTime($StartTime), 'Online' => 1)); 87 87 } 88 88 $DbResult = $this->Database->update('NetworkDevice', '`LastOnline` < "'.TimeToMysqlDateTime($StartTime).'"', array('Online' => 0));
Note:
See TracChangeset
for help on using the changeset viewer.