webmain/model/deptModel.php
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
class deptClassModel extends Model
{
public $firstpid,$groupids,$temparaa;
/**
* $uarr 相应人员才能查看对应部门数据
*/
public function getdata($uarr=array())
{
$darr = $dtotal =array();
$gids = '0';
$dbs = m('admin');
//要权限判断
if(is_array($uarr)){
$did = '0';
if($uarr)foreach($uarr as $k=>$rs){
$dpath = str_replace(array('[',']'), array('',''), $rs['deptpath']);
if(!isempt($dpath)){
$dpatha = explode(',', $dpath);
foreach($dpatha as $dpatha1){
if(isempt($dpatha1))continue;
$darr[$dpatha1]=$dpatha1;
if(!isset($dtotal[$dpatha1]))$dtotal[$dpatha1]=0;
$dtotal[$dpatha1]++;
}
}
if(!isempt(arrvalue($rs,'groupname')))$gids.=','.$rs['groupname'].'';
}
foreach($darr as $k1=>$v1)$did.=','.$k1.'';
$where= 'id in('.$did.')';
if(isempt($this->rock->get('changerange'))){
if((int)$dbs->getmou('type', $this->adminid)==1){
$where = '1=1'; //管理员可看全部
}else{
$where1= m('view')->viewwhere('dept', $this->adminid, 'id');
if(contain($where1,'1=1')){
$where = '1=1'; //全部
}else{
$where = '`id`>0 and ((1 '.$where1.') or (id in('.$did.')))';
}
}
}
}else{
$where = '1=1';
}
$this->firstpid = 0;
//多单位
if(ISMORECOM){
$sysalluview = ','.m('option')->getval('sysalluview','0').',1,';
if(!contain($sysalluview,','.$this->adminid.',')){
$comid = $dbs->getcompanyid();
$where.=' and `companyid` in(0,'.$comid.') and `id`>1';
$this->firstpid = 1;
}
}
$rows = $this->getall($where,'`id`,`name`,`pid`,`sort`','`pid`,`sort`');
后面还有 110 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
