'', 'uid' => '', 'type' => '', 'permission' => '', 'url' => '', ); public function getUserPermissionByType($uid, $uniacid, $type = '') { $this->query->where('uid', $uid)->where('uniacid', $uniacid); if (!empty($type)) { $this->query->where('type', $type); } $result = $this->query->get(); if (!empty($result['permission'])) { $result['permission'] = explode('|', $result['permission']); } return $result; } public function getAllUserPermission($uid, $uniacid) { return $this->query->where('uid', $uid) ->where('uniacid', $uniacid)->getall('type'); } public function getAllUserModulePermission($uid, $uniacid) { return $this->query->where('uid', $uid) ->where('uniacid', $uniacid) ->where('type !=', array(PERMISSION_ACCOUNT, PERMISSION_WXAPP, PERMISSION_WEBAPP, PERMISSION_PHONEAPP, PERMISSION_XZAPP, PERMISSION_ALIAPP, PERMISSION_BAIDUAPP, PERMISSION_TOUTIAOAPP, PERMISSION_SYSTEM))->getall('type'); } public function getUserExtendPermission() {} public function getClerkPermission($module) { global $_W; return $this->query->from('users_permission', 'p')->leftjoin('uni_account_users', 'u')->on(array('u.uid' => 'p.uid', 'u.uniacid' => 'p.uniacid'))->where('u.role', 'clerk')->where('p.type', $module)->where('u.uniacid', $_W['uniacid'])->getall('uid'); } }