easypanel/framework/api/flow.api.php
2023-08-25 10:53:15 +08:00

40 lines
No EOL
746 B
PHP

<?php
load_lib('pub:flow');
class FlowAPI extends API
{
private $flowobj;
public function __construct()
{
$flowobj = new flow('global.db');
$this->flowobj = $flowobj;
}
public function getFlow($table, $name, $t)
{
return $this->flowobj->getFlow($table, $name, $t);
}
public function getListflow($table, $t)
{
return $this->flowobj->getListflow($table, $t);
}
public function getMonthFlow($name, $t)
{
$result = $this->flowobj->getMonthFlow($name, $t);
return $result;
}
/**
* 得到虚拟主机当前月流量
* @param $name
* @return Ambigous <mixed, boolean>
*/
public function getCurrentMonthFlow($name)
{
return $this->getMonthFlow($name, date('Ym'));
}
}
?>