feat: init project codebase

This commit is contained in:
sinde21
2026-09-14 16:32:07 +08:00
parent c4b2a15757
commit da20fde7fb
140 changed files with 27855 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Dept_model extends CI_Model
{
/**
* 机构模型部分
*/
function __construct()
{
parent::__construct();
$this->load->database();
}
/**
* 获取所有机构列表
*/
function getDeptList()
{
$sql = "SELECT
d.id,
d.pid,
d.name,
d.aliasname,
d.listorder,
d.status
FROM
sys_dept d
ORDER BY
d.listorder";
$query = $this->db->query($sql);
return $query->result_array();
}
/**
* @param $Id
* @return bool
* 含有子节点返回真
*/
function hasChildDept($Id){
$sql ="SELECT * FROM `sys_dept` where pid=" . $Id;
$query = $this->db->query($sql);
if(empty($query->result_array())) {
return FALSE;
} else {
return TRUE;
}
}
}