webmain/system/dept/deptAction.php

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
class deptClassAction extends Action
{
	private $allid,$rows;
	
	public function defaultAction()
	{
		
	}
	
	public function dataAjax()
	{
		$carr		= m('admin')->getcompanyinfo(0,5);
		$this->allid= $carr['companyallid'];
		
		$this->rows	= array();
		$this->getdept(0, 1);
		$errmsg = '';
		if(ISMORECOM){
			foreach($this->rows as $k1=>$rs1){
				if($rs1['companyname']=='' && $rs1['level']==2){
					$this->rows[$k1]['trbgcolor']='red';
					$errmsg = '1';
				}
			}
			if($errmsg=='1')$errmsg='红色行必须选择所属单位,请编辑';
		}
		echo json_encode(array(
			'totalCount'=> 0,
			'rows'		=> $this->rows,
			'carr'		=> $carr,
			'errmsg'	=> $errmsg
		));
	}
	
	private function getdept($pid, $oi)
	{
		$db		= m('dept');
		$menu	= $db->getall("`pid`='$pid' order by `sort`",'*');
		foreach($menu as $k=>$rs){
			$comid 			= $rs['companyid'];
			
			//开启单位模式只能看到自己单位下的组织结构
			if(!in_array($comid, $this->allid) && $this->adminid>1 && getconfig('companymode'))continue;
			
			$companyname	= '';
			if($comid>0 && getconfig('companymode'))$companyname = m('company')->getmou('name', $comid);
			$rs['companyname'] = $companyname;
			$sid			= $rs['id'];
			$rs['level']	= $oi;
			$rs['stotal']	= $db->rows("`pid`='$sid'");
			$this->rows[] = $rs;
			
			$this->getdept($sid, $oi+1);
			
		}
	}
	
	public function publicbeforesave($table, $cans, $id)
	{
后面还有 101 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。