IBOS open source
  • Namespace
  • Class

Namespaces

  • application
    • core
      • cache
        • driver
        • provider
      • components
      • controllers
      • engines
        • local
        • sae
      • model
      • modules
      • utils
      • widgets
    • modules
      • article
        • controllers
        • core
        • model
        • utils
      • calendar
        • controllers
        • model
        • utils
      • contact
        • controllers
        • model
        • utils
      • dashboard
        • controllers
        • model
        • utils
      • department
        • components
        • model
        • utils
      • diary
        • components
        • controllers
        • model
        • utils
        • widgets
      • email
        • controllers
        • core
        • model
        • utils
      • main
        • behaviors
        • components
        • controllers
        • model
        • utils
        • widgets
      • message
        • controllers
        • core
          • co
          • wx
            • callback
            • event
        • model
        • utils
      • mobile
        • components
        • controllers
        • utils
      • position
        • components
        • model
        • utils
      • recruit
        • components
        • controllers
        • core
        • model
        • utils
        • widgets
      • role
        • model
        • utils
      • user
        • components
        • controllers
        • model
        • utils
      • vote
        • components
        • controllers
        • model
        • utils
      • weibo
        • controllers
        • core
        • model
        • utils

Classes

  • Department
  • DepartmentRelated

Class Department

CActiveRecord
Extended by application\core\model\Model
Extended by application\modules\department\model\Department
Namespace: application\modules\department\model
Copyright: Copyright © 2012-2013 IBOS Inc
Author: banyanCheung banyan@ibos.com.cn
Located at system/modules/department/model/Department.php

Methods summary

public static
# model( $className = __CLASS__ )
public
# tableName( )
public string
# queryDept( string $deptid, boolean $connect = false )

根据单个或多个部门ID(用英文,号隔开)得到其所有父部门id,包括父部门的父部门

根据单个或多个部门ID(用英文,号隔开)得到其所有父部门id,包括父部门的父部门

Parameters

$deptid
部门Id
$connect
是否链接$deptid返回

Returns

string
public string
# fetchChildIdByDeptids( integer $deptids, boolean $connect = false )

返回deptids取得所有子分类id字符串,逗号分割

返回deptids取得所有子分类id字符串,逗号分割

Parameters

$deptids
逗号分割的deptid,也有可能是单个的部门
$connect
返回是否需要连接上原来部门id

Returns

string
逗号分割的字符串,部门id
public array
# fetchChildDeptByDeptid( integer $deptid, array $departArr )

通过$deptid取得子类department

通过$deptid取得子类department

Parameters

$deptid
部门Id
$departArr
部门列表

Returns

array
$result 子部门数组

Author

gzwwb
public integer
# fetchManagerByDeptid( integer $deptid )

根据deptid获取部门的主管ID

根据deptid获取部门的主管ID

Parameters

$deptid

Returns

integer
public string
# fetchDeptNameByDeptId( mixed $id, string $glue = ',', boolean $returnFirst = false )

根据部门ID查找部门名称,返回$glue分隔的部门名称字符串

根据部门ID查找部门名称,返回$glue分隔的部门名称字符串

Parameters

$id
$ids 部门ID数组或逗号分隔字符串
$glue
分隔符
$returnFirst
是否返回第一个

Returns

string
public string
# fetchDeptNameByUid( integer $uid, $glue = ',', $returnFirst = false )

根据用户uid获取用户所在部门的部门名称

根据用户uid获取用户所在部门的部门名称

Parameters

$uid
默认为0,即为获取当前登录用户的uid
$glue
$returnFirst

Returns

string
public integer
# getIsBranch( integer $id )

判断某个部门是否属于分支机构

判断某个部门是否属于分支机构

Parameters

$id
部门id

Returns

integer
public integer
# countChildByDeptId( integer $id )

查看当前部门下是否还有子部门

查看当前部门下是否还有子部门

Parameters

$id
部门id

Returns

integer
public array
# getBranchParent( integer $deptid )

根据部门id,获取其所属分支的部门,若没有,返回除了“总公司”最大的部门 以前:如果没有设置分支,则返回空数组

根据部门id,获取其所属分支的部门,若没有,返回除了“总公司”最大的部门 以前:如果没有设置分支,则返回空数组

Parameters

$deptid

Returns

array
分支部门的数组

Methods inherited from application\core\model\Model

add(), beforeDelete(), create(), deleteByPk(), fetch(), fetchAll(), fetchAllByAttributes(), fetchAllByPk(), fetchAllSortByPk(), fetchByAttributes(), fetchByPk(), fetchCache(), fetchCaches(), getCacheKey(), getIsAllowCache(), getMaxId(), getModelClass(), init(), modify(), remove(), updateAll(), updateByPk()

Properties summary

protected mixed $allowCache

是否允许缓存

是否允许缓存

# true

Properties inherited from application\core\model\Model

$cacheLife

IBOS open source API documentation generated by ApiGen