当前位置: 首页>>代码示例>>PHP>>正文


PHP Browse::getAuthorGroup方法代码示例

本文整理汇总了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;
//.........这里部分代码省略.........
开发者ID:tmlsoft,项目名称:main,代码行数:101,代码来源:Browse.class.php


注:本文中的Browse::getAuthorGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。