mirror of
https://gh.wpcy.net/https://github.com/netcccyun/easypanel.git
synced 2026-04-22 19:44:04 +08:00
60 lines
No EOL
1.3 KiB
PHP
60 lines
No EOL
1.3 KiB
PHP
<?php
|
|
class ViewsDAO extends DAO
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->MAP_ARR = array('id' => 'id', 'name' => 'name', 'desc' => 'desc', 'key' => 'key');
|
|
$this->MAP_TYPE = array();
|
|
$this->_TABLE = 'views';
|
|
$this->_DBFILE = 'dns';
|
|
}
|
|
|
|
public function getView($name)
|
|
{
|
|
return $this->select(null, $this->getFieldValue2('name', $name), 'row');
|
|
}
|
|
|
|
public function viewsAdd($arr)
|
|
{
|
|
return $this->insert($arr, 'replace');
|
|
}
|
|
|
|
public function viewsDel($name = null)
|
|
{
|
|
$where = null;
|
|
|
|
if ($name != null) {
|
|
$where = $this->getFieldValue2('name', $name);
|
|
}
|
|
|
|
return $this->delData($where);
|
|
}
|
|
|
|
public function viewsList($where_arr = null, $fields = null)
|
|
{
|
|
$where = '1=1 order by id desc';
|
|
return $this->select($fields, $where, 'rows');
|
|
}
|
|
|
|
public function viewChange($name, $arr)
|
|
{
|
|
return $this->update($arr, $this->getFieldValue2('name', $name));
|
|
}
|
|
|
|
public function viewUpdate($name, $arr)
|
|
{
|
|
return $this->update($arr, $this->getFieldValue2('name', $name));
|
|
}
|
|
|
|
public function viewsPageList($page, $page_count, &$count)
|
|
{
|
|
$fields = array('id', 'name', 'desc', 'key');
|
|
$where = null;
|
|
$order_field = 'name';
|
|
$desc = true;
|
|
return $this->selectPage($fields, $where, $order_field, $desc, $page, $page_count, $count);
|
|
}
|
|
}
|
|
|
|
?>
|