function actionTraffic() { $sql = "SELECT SUM( acctinputoctets + acctoutputoctets ) as total FROM radacct WHERE UserName = '******'"; $traffic_total = QDB::getConn()->getOne($sql); $this->_view['traffic_total'] = $traffic_total; $page = (int) $this->_context->get('page', 1); $orm = Radacct::find('username =?', $this->_user_name)->order('radacctid desc'); $orm->limitPage($page, 12); $this->_view['rs'] = $orm->getAll(); $this->_view['pg'] = $orm->getPag(); }
function actionOnline() { $rs = Radacct::find()->where('acctstoptime IS NULL')->getAll(); $this->_view['rs'] = $rs; }