mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-01-22 10:35:18 +08:00
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
/*
|
|
* @copyright Leyun internet Technology(Shanghai)Co.,Ltd
|
|
* @license http://www.dzzoffice.com/licenses/license.txt
|
|
* @package DzzOffice
|
|
* @link http://www.dzzoffice.com
|
|
* @author zyx(zyx@dzz.cc)
|
|
*/
|
|
if(!defined('IN_DZZ')) {
|
|
exit('Access Denied');
|
|
}
|
|
|
|
class table_district extends dzz_table
|
|
{
|
|
public function __construct() {
|
|
|
|
$this->_table = 'district';
|
|
$this->_pk = 'id';
|
|
|
|
parent::__construct();
|
|
}
|
|
|
|
public function fetch_all_by_upid($upid, $order = null, $sort = 'DESC') {
|
|
$upid = is_array($upid) ? array_map('intval', (array)$upid) : dintval($upid);
|
|
if($upid !== null) {
|
|
$ordersql = $order !== null && !empty($order) ? ' ORDER BY '.DB::order($order, $sort) : '';
|
|
return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('upid', $upid)." $ordersql", array($this->_table), $this->_pk);
|
|
}
|
|
return array();
|
|
}
|
|
|
|
public function fetch_all_by_name($name) {
|
|
if(!empty($name)) {
|
|
return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('name', $name), array($this->_table));
|
|
}
|
|
return array();
|
|
}
|
|
|
|
}
|
|
|
|
?>
|