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

  • Login
  • User

Class User

Namespace: application\modules\user\utils
Located at system/modules/user/utils/User.php

Methods summary

public static string|null
# getUserProfile( $field )

获取用户资料

获取用户资料

Returns

string|null
public static type
# loadUser( mixed $uids = '' )

加载用户缓存,其中键对应uid 如果有传入$uids,如果是'1,2,3'格式的字符串,则转成数组,如果array(1,2,3),继续: 1、如果传入的uid存在,则取出来,重新组合成一个新的数组,格式和不传入$uids的格式一样: array( 1 => array( 'uid' => 1, 'username' => '沐筱琴', 'isadministrator' => 1, 'deptid' => 1, 'positionid' => 1, 'roleid' => 1, 'upuid' => 0, 'groupid' => 2, 'jobnumber' => '萌萌哒', 'realname' => '沐筱琴', 'password' => 'b04bdfc08616188a32754e21a43e6ee6', 'gender' => 0, 'weixin' => 'forsona', 'mobile' => '13250302684', 'email' => '2317216477@qq.com', 'status' => 0, 'createtime' => '1435830015', 'credits' => 2, 'newcomer' => 1, 'salt' => 'LTmRXK', 'validationemail' => 0, 'validationmobile' => 0, 'lastchangepass' => '1435907360', 'guid' => '31163F94-7736-6798-3EE7-54011002FF5C', 'group_title' => '初入江湖', 'upgrade_percent' => 4, 'next_group_credit' => 50, 'level' => 2, 'alldeptid' => '6,1', 'allupdeptid' => '', 'alldowndeptid' => '7,8,2,3,4,5,9', 'relatedDeptId' => 6, 'deptname' => '广州', 'allposid' => '1,3', 'relatedPosId' => '3', 'posname' => '总经理', 'allroleid' => '1,3', 'relatedRoleId' => '3', 'rolename' => '管理员', 'space_url' => '?r=user/home/index&uid=1', 'avatar_middle' => 'static.php?type=avatar&uid=1&size=middle&engine=LOCAL', 'avatar_small' => 'static.php?type=avatar&uid=1&size=small&engine=LOCAL', 'avatar_big' => 'static.php?type=avatar&uid=1&size=big&engine=LOCAL', 'bg_big' => 'static.php?type=bg&uid=1&size=big&engine=LOCAL', 'bg_small' => 'static.php?type=bg&uid=1&size=small&engine=LOCAL', 'birthday' => '0', 'telephone' => '', 'address' => '', 'qq' => '', 'bio' => '', 'remindsetting' => '', ), 2 => array( //... ), ); 2、如果传入的uid都不存在,则直接返回全数组 3、如果不传入uids,则返回全数组

加载用户缓存,其中键对应uid 如果有传入$uids,如果是'1,2,3'格式的字符串,则转成数组,如果array(1,2,3),继续: 1、如果传入的uid存在,则取出来,重新组合成一个新的数组,格式和不传入$uids的格式一样: array( 1 => array( 'uid' => 1, 'username' => '沐筱琴', 'isadministrator' => 1, 'deptid' => 1, 'positionid' => 1, 'roleid' => 1, 'upuid' => 0, 'groupid' => 2, 'jobnumber' => '萌萌哒', 'realname' => '沐筱琴', 'password' => 'b04bdfc08616188a32754e21a43e6ee6', 'gender' => 0, 'weixin' => 'forsona', 'mobile' => '13250302684', 'email' => '2317216477@qq.com', 'status' => 0, 'createtime' => '1435830015', 'credits' => 2, 'newcomer' => 1, 'salt' => 'LTmRXK', 'validationemail' => 0, 'validationmobile' => 0, 'lastchangepass' => '1435907360', 'guid' => '31163F94-7736-6798-3EE7-54011002FF5C', 'group_title' => '初入江湖', 'upgrade_percent' => 4, 'next_group_credit' => 50, 'level' => 2, 'alldeptid' => '6,1', 'allupdeptid' => '', 'alldowndeptid' => '7,8,2,3,4,5,9', 'relatedDeptId' => 6, 'deptname' => '广州', 'allposid' => '1,3', 'relatedPosId' => '3', 'posname' => '总经理', 'allroleid' => '1,3', 'relatedRoleId' => '3', 'rolename' => '管理员', 'space_url' => '?r=user/home/index&uid=1', 'avatar_middle' => 'static.php?type=avatar&uid=1&size=middle&engine=LOCAL', 'avatar_small' => 'static.php?type=avatar&uid=1&size=small&engine=LOCAL', 'avatar_big' => 'static.php?type=avatar&uid=1&size=big&engine=LOCAL', 'bg_big' => 'static.php?type=bg&uid=1&size=big&engine=LOCAL', 'bg_small' => 'static.php?type=bg&uid=1&size=small&engine=LOCAL', 'birthday' => '0', 'telephone' => '', 'address' => '', 'qq' => '', 'bio' => '', 'remindsetting' => '', ), 2 => array( //... ), ); 2、如果传入的uid都不存在,则直接返回全数组 3、如果不传入uids,则返回全数组

Parameters

$uids

Returns

type
public static
# exportUser( mixed $uids )

导出用户xml格式

导出用户xml格式

Parameters

$uids
public static
# cleanCache( integer $uid )

清空某用户的缓存

清空某用户的缓存

Parameters

$uid
public static boolean
# checkDataPurv( type $purvId )

Parameters

$purvId
$accessId

Returns

boolean
public static boolean
# setPosition( integer $positionId, array $users )

从岗位维度设置用户的岗位

从岗位维度设置用户的岗位

Parameters

$positionId
$users

Returns

boolean
public static array
# wrapUserInfo( array $user )

封装一个用户数组,增加一些常用的参数

封装一个用户数组,增加一些常用的参数

Parameters

$user
引用用户数组

Returns

array
public static string
# getHomeBg( integer $uid )

获取指定用户的个人首页banner

获取指定用户的个人首页banner

Parameters

$uid
用户ID

Returns

string
public static integer
# getUserLevel( array $groupid )

获取用户等级

获取用户等级

Parameters

$groupid
$user 用户数组

Returns

integer
public static
# checkUserGroup( integer $uid = 0 )

校验用户组

校验用户组

Parameters

$uid
public static
# batchUpdateCredit( application\core\utils\String $action, Integer $uids = 0, array $extraSql = array(), Integer $coef = 1 )

批量执行某一条策略规则

批量执行某一条策略规则

Parameters

$action
$action: 规则action名称
$uids
$uids: 操作用户可以为单个uid或uid数组
$extraSql
$extrasql: user_count的额外操作字段数组格式为 array('extcredits1' => '1')
$coef
$coef: 积分放大倍数,当为负数时为反转操作
public static
# updateUserCount( Integer $uids, application\core\utils\String $dataArr = array(), Boolean $checkGroup = true, application\core\utils\String $operation = '', Integer $relatedid = 0, application\core\utils\String $ruletxt = '' )

添加积分

添加积分

Parameters

$uids
$uids: 用户uid或者uid数组
$dataArr
$dataarr: member count相关操作数组,例: array('threads' => 1, 'doings' => -1)
$checkGroup
$checkgroup: 是否检查用户组 true or false
$operation
$operation: 操作类型
$relatedid
$relatedid:
$ruletxt
$ruletxt: 积分规则文本
public static 返回积分策略
# updateCreditByAction( string $action, integer $uid = 0, array $extraSql = array(), string $needle = '', integer $coef = 1, integer $update = 1 )

根据某个动作执行积分规则

根据某个动作执行积分规则

Parameters

$action
$action: 规则action名称
$uid
$uid: 操作用户
$extraSql
$extrasql: user_count的额外操作字段数组格式为 array('extcredits1' => '1')
$needle
$needle: 防重字符串
$coef
$coef: 积分放大倍数
$update
$update: 是否执行更新操作

Returns

返回积分策略
public static type
# creditLog( type $uids, type $operation, type $relatedid, type $data )

积分记录日志

积分记录日志

Parameters

$uids
$operation
$relatedid
$data

Returns

type
public static array
# getManagerDeptSubUserByUid( integer $uid )

取得该用户的所有直属下属及下属所在部门数据

取得该用户的所有直属下属及下属所在部门数据

Parameters

$uid

Returns

array
//返回带直属下属的部门及其这个部门的直属下属数组
public static boolean
# hasSubUid( type $uid )

通过uid判断是否存在下属

通过uid判断是否存在下属

Parameters

$uid

Returns

boolean
public static type
# getAllSubs( integer $uid, string $limitCondition = '', boolean $uidFlag = false )

取得该用户的所有下属数据

取得该用户的所有下属数据

Parameters

$uid
$limitCondition
默认为空,取全部
$uidFlag
是否只返回uid数组

Returns

type
public static boolean
# checkIsSub( integer $uid, integer $subUid )

判断某个uid是否是另一个uid的下属

判断某个uid是否是另一个uid的下属

Parameters

$uid
参照上司uid
$subUid
参照下属uid

Returns

boolean
public static boolean
# checkIsUpUid( integer $uid, integer $upUid )

判断某个uid是否是另一个uid的直属上司

判断某个uid是否是另一个uid的直属上司

Parameters

$uid
参照下属uid
$upUid
参照直属上司uid

Returns

boolean
public static integer
# getSupUid( integer $uid )

获取上司UID

获取上司UID

Parameters

$uid

Returns

integer
上司uid,没上司就返回0
public static string
# getAvatar( integer $uid, string $size = 'middle' , string $type,… )

获取指定用户头像的文件路径存放地址

获取指定用户头像的文件路径存放地址

Parameters

$uid
用户ID
$size
头像尺寸
$type,…

Returns

string
public static string
# getBg( integer $uid, string $size = 'small' )

获取指定用户背景图文件路径存放地址

获取指定用户背景图文件路径存放地址

Parameters

$uid
用户ID
$size
背景尺寸

Returns

string
public static string
# getTempBg( string $name, string $size )

获取系统自带背景

获取系统自带背景

Parameters

$name
图片名(目前有temp1,temp2,temp3)
$size
要获取的背景图大小(big middle small)

Returns

string
public static boolean
# isOnline( integer $uid )

查看指定uid是否在线

查看指定uid是否在线

Parameters

$uid
用户ID

Returns

boolean
public static integer
# getOnlineStatus( integer $uid )

获得指定uid 在线状态 -1 为离线,0为在线,1为忙碌,2为离开

获得指定uid 在线状态 -1 为离线,0为在线,1为忙碌,2为离开

Parameters

$uid
用户ID

Returns

integer
public static
# checkNavPurv( type $nav )

检查导航权限

检查导航权限

Parameters

$nav
public static array
# getUserPurv( integer $uid )

获取用户权限

获取用户权限

Parameters

$uid
用户ID

Returns

array
权限数组
public static type
# getUserByPy( array $uids = NULL, integer $first = false )

按拼音排序用户

按拼音排序用户

Parameters

$uids
要排序的用户uid
$first

Returns

type
public static json
# getJsConstantUids( $uid )

获取封装后的js选人框常用联系人uid数组

获取封装后的js选人框常用联系人uid数组

Returns

json
public static array
# getAccountSetting( )

获取安全配置和密码验证规则

获取安全配置和密码验证规则

Returns

array
public static array
# handleUserGroupByDept( array $users )

将一个用户数组按部门分组,返回以相同部门为一组的用户数组,并且带部门名称;

将一个用户数组按部门分组,返回以相同部门为一组的用户数组,并且带部门名称;

Parameters

$users
用户数组

Returns

array
IBOS open source API documentation generated by ApiGen