本文整理匯總了PHP中Browse::getAuthorGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browse::getAuthorGroup方法的具體用法?PHP Browse::getAuthorGroup怎麽用?PHP Browse::getAuthorGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Browse
的用法示例。
在下文中一共展示了Browse::getAuthorGroup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getBrowseList
/**
* +----------------------------------------------------------
* 取得當前認證號的所有瀏覽map
* +----------------------------------------------------------
*
* @param integer $authId
* 用戶ID
* +----------------------------------------------------------
* @access public
* +----------------------------------------------------------
*/
public static function getBrowseList($authId)
{
// 獲取當前用戶所有組
$myallroles = Browse::getAuthorGroup($authId);
$rolesstr = implode(',', array_filter($myallroles));
$MisSystemDataAccessViewModel = D("MisSystemDataAccessView");
$MisSystemDataAccessModelQuoteModel = M("mis_system_data_access_model_quote");
// 查詢當前用戶的瀏覽權限
if ($authId) {
$db = Db::getInstance(C('RBAC_DB_DSN'));
$userborwseList = $MisSystemDataAccessViewModel->where("mis_system_data_access_mas.status = 1 and startstatus=1 and mis_system_data_access_sub.accesscontent !='' and mis_system_data_access_sub.accesscontent is not null")->order("actionname,tablename,fieldname")->select();
//根據用戶組裝一個數組
$userAllborwseList = $MisSystemDataAccessViewModel->where("mis_system_data_access_mas.status = 1 and startstatus=1 and mis_system_data_access_sub.accesscontent !='' and mis_system_data_access_sub.accesscontent is not null AND ( ( mis_system_data_access_sub.objtype = 1) AND (mis_system_data_access_sub.objid = " . $authId . ")) OR ((mis_system_data_access_sub.objtype=2) AND (mis_system_data_access_sub.`objid` IN (" . $rolesstr . "))) ")->order("actionname,tablename,fieldname")->select();
$userNewAlllist = array();
foreach ($userAllborwseList as $userkey => $userval) {
$userNewAlllist[$userval['actionname']][$userval['fieldname']][] = $userval;
}
//print_r($userborwseList);
$MisSystemDataAccessModelQuoteList = $MisSystemDataAccessModelQuoteModel->where("status=1")->select();
foreach ($MisSystemDataAccessModelQuoteList as $mqkey => $mqval) {
$MisSystemDataAccessModelQuoteNewList[$mqval['actionname']][] = $mqval;
}
//查詢繼承數據權限表單
$list = array();
if ($userborwseList) {
$formArr = array();
$dformArr = array();
foreach ($userborwseList as $ukey => $uval) {
$tablename = D($uval['actionname'])->getTablename();
if ($uval['fieldname']) {
if ($uval['accesscontenttype'] == 2) {
//分組授權
$groupval = "";
//分組所得數據權限
foreach ($userNewAlllist[$uval['actionname']][$uval['fieldname']] as $nekey => $neval) {
$groupval[] = Browse::getGroupVal($neval['accesscontent']);
}
$str = implode(',', array_values($groupval));
} else {
$newval = "";
//分組所得數據權限
foreach ($userNewAlllist[$uval['actionname']][$uval['fieldname']] as $nekey => $neval) {
$newval .= $neval['accesscontent'];
}
$str = $newval;
}
if ($uval['typeid'] == 1) {
if ($uval['isalldata'] == 1 || $str) {
//主表字段
if ($formArr[$uval['actionname']][$uval['fieldname']]) {
$newstr = $formArr[$uval['actionname']][$uval['fieldname']] . ',' . $str;
$formArr[$uval['actionname']][$uval['fieldname']] = $newstr;
//$newmap=$list[$uval ['actionname']]['formsql'] . " AND {$uval['fieldname']} in (" . $newstr .")";
} else {
$formArr[$uval['actionname']][$uval['fieldname']] = $str;
}
if ($list[$uval['actionname']]['formsql']) {
$newmap = $list[$uval['actionname']]['formsql'] . " AND {$tablename}.{$uval['fieldname']} in (" . $formArr[$uval['actionname']][$uval['fieldname']] . ")";
} else {
$newmap = "{$tablename}.{$uval['fieldname']} in (" . $formArr[$uval['actionname']][$uval['fieldname']] . ")";
}
if ($uval['fieldname'] != $userborwseList[$ukey + 1]['fieldname']) {
$list[$uval['actionname']]['formsql'] = $newmap;
}
if ($uval['actionname'] != $userborwseList[$ukey + 1]['actionname']) {
$list[$uval['actionname']]['formsql'] = $newmap;
}
if ($uval['accesscontentcategory'] == 1) {
//selectlist.inc
if ($selectlist[$uval['actionname']][$uval['accesscontentsave']]) {
$selectlist[$uval['actionname']][$uval['accesscontentsave']] .= ',' . $str;
} else {
$selectlist[$uval['actionname']][$uval['accesscontentsave']] = $str;
}
$list[$uval['actionname']]['selectlist'] = $selectlist[$uval['actionname']];
} else {
$list[$uval['actionname']][$uval['accesscontentsource']] = array($uval['accesscontentsave'] => $formArr[$uval['actionname']][$uval['fieldname']]);
}
}
} else {
//內嵌表
$newmap = "";
if ($dformArr[$uval['actionname']][$uval['tablename']][$uval['fieldname']]) {
//echo $dformArr[$uval['actionname']][$uval['tablename']][$uval['fieldname']];exit;
$dnewstr = $dformArr[$uval['actionname']][$uval['tablename']][$uval['fieldname']] . ',' . $str;
$dformArr[$uval['actionname']][$uval['tablename']][$uval['fieldname']] = $dnewstr;
//$newmap=$list[$uval ['actionname']][$uval['tablename']]['formsql'] . " AND {$uval['fieldname']} in (" . $str .")";
} else {
$dformArr[$uval['actionname']][$uval['tablename']][$uval['fieldname']] = $str;
//.........這裏部分代碼省略.........