Final fixes for billing

This commit is contained in:
laf
2016-07-17 20:35:50 +01:00
parent 47f7c37b03
commit 5a9a963a03
3 changed files with 9 additions and 6 deletions

View File

@@ -79,9 +79,9 @@ function getValue($host, $port, $id, $inout) {
}//end getValue()
function getLastPortCounter($port_id) {
function getLastPortCounter($port_id, $bill_id) {
$return = array();
$row = dbFetchRow("SELECT timestamp, in_counter, in_delta, out_counter, out_delta FROM bill_port_counters WHERE `port_id` = ?", array($port_id));
$row = dbFetchRow("SELECT timestamp, in_counter, in_delta, out_counter, out_delta FROM bill_port_counters WHERE `port_id` = ? AND `bill_id` = ?", array($port_id, $bill_id));
if (!is_null($row)) {
$return[timestamp] = $row['timestamp'];
$return[in_counter] = $row['in_counter'];