本文整理汇总了PHP中Browse::getUserMap方法的典型用法代码示例。如果您正苦于以下问题:PHP Browse::getUserMap方法的具体用法?PHP Browse::getUserMap怎么用?PHP Browse::getUserMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browse
的用法示例。
在下文中一共展示了Browse::getUserMap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showPanel
/**
* 显示当前面板内容
* @Title: showPanel
* @Description: todo(页面展示)
* @author 管理员
* @date 2015-06-30 19:36:36
* @throws
*/
public function showPanel()
{
import('@.ORG.Browse');
$submodel = M("mis_system_panel_desing_sub");
$sublist = $submodel->where("masid=15")->select();
$scdmodel = D("SystemConfigDetail");
$map["status"] = 1;
foreach ($sublist as $key => $val) {
$model = $val["modelname"];
$fields = explode(",", $val["showtitle"]);
$defaultwidth = (int) 100 / count($fields);
$temp = explode(",", $val["showtitle"]);
foreach ($temp as $tk => $tv) {
$temparr = explode("|", $tv);
if ($temparr[2]) {
$fields[$temparr[0]]['name'] = $temparr[0];
$fields[$temparr[0]]['width'] = $temparr[1];
$fields[$temparr[0]]['sort'] = $temparr[2];
}
}
sortArray($fields, 'sort', 'asc', 'number');
$detailList = $scdmodel->getDetail($model, true, "", "status");
$sublist[$key]['link'] = __APP__ . "/" . $model . "/index";
$sublist[$key]['rel'] = $model;
$newd = array();
foreach ($fields as $k => $v) {
foreach ($detailList as $dk => $dv) {
if ($v['name'] == $dv['name']) {
$newd[$k] = $dv;
$newd[$k]['shows'] = 1;
$newd[$k]['sortnum'] = $v['sort'];
if (strpos('px', $v['width']) > 0 || strpos('PX', $v['width']) > 0 || strpos('Px', $v['width']) > 0) {
$newd[$k]['widths'] = $v['width'];
} else {
$newd[$k]['widths'] = $v['width'] ? $v['width'] . "%" : $defaultwidth . "%";
}
}
}
}
$sublist[$key]["detailList"] = $newd;
//具体数据1
$listmodel = D($model);
$val['num'] = $val['num'] ? $val['num'] : 5;
//获取当前模型数据权限 by renl 20150626
$broMap = Browse::getUserMap($model);
if ($broMap) {
if ($map['_string']) {
$map['_string'] .= " and " . $broMap;
} else {
$map['_string'] = $broMap;
}
}
$list = $listmodel->where($map)->order('id desc')->limit($val['num'])->select();
$sublist[$key]["list"] = $list;
unset($map["_string"]);
}
$this->assign("sublist", $sublist);
$this->display("MisSystemPanelDesingMas:news");
}
示例2: _list
/**
+----------------------------------------------------------
* 根据表单生成查询条件
* 进行列表过滤
+----------------------------------------------------------
* @access protected
+----------------------------------------------------------
* @param Model $model 数据对象
* @param HashMap $map 过滤条件
* @param string $sortBy 排序
* @param boolean $asc 是否正序
* @param mothed $mothed 针对_list查询完后对返回的数组进行再次处理,所以需要传入一个处理方法名。
* @param module $modules 如果当前传入的$name 是视图的话,是无法用method_exists方法,所以需要多传入一个当前模型名字。
* @param echoSql 当等1时, 输出记算行数的sql语名;
* @param $sorttype 字符串排序(多字段时使用) (exec: parentid desc,id asc) 2015-8-3 14:15 Write By xyz
+----------------------------------------------------------
* @return void
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
protected function _list($name, $map, $sortBy = '', $asc = false, $group = '', $echoSql = '', $sortstr = '', $limit = true)
{
import('@.ORG.Browse');
//map附加
//提醒条件
if ($_REQUEST['remindMap']) {
$remindMap = base64_decode($_REQUEST['remindMap']);
if ($map['_string']) {
$map['_string'] .= " and " . $remindMap;
} else {
$map['_string'] = $remindMap;
}
$this->assign("remindMap", $_REQUEST['remindMap']);
}
//权限验证条件
$getactionname = $this->getActionName();
$alicname = array("MisSalesMyProject", "MisSystemClientChangeRole");
if ($_SESSION['a'] != 1 && ($name == $this->getActionName() || in_array($getactionname, $alicname))) {
//当遇到项目项目模型查询数据权限的时候,进行转移到项目动态信息
$newname = $this->getActionName() == "MisSalesMyProject" ? "MisAutoPvb" : $name;
$broMap = Browse::getUserMap($newname);
//添加商机特殊数据权限过滤
if ($name == "MisSaleMyBusiness") {
if (!$_POST['isbrows']) {
unset($broMap);
}
}
//echo 111;
if ($_REQUEST['projectid'] && $_REQUEST['projectworkid']) {
$map['projectid'] = $_REQUEST['projectid'];
}
//将以前所有的$map置前,以免和转授权起冲突--放于$broMap判断之前
if ($broMap) {
if ($map['_string']) {
if (is_string($broMap) !== false) {
$map['_string'] .= " and " . $broMap;
//自身权限
} else {
if (is_array($broMap)) {
if ($broMap[0]) {
$map['_string'] .= " and " . $broMap[0];
//自身权限
}
if ($broMap[1]) {
//转授权限
$map["_logic"] = "and";
$m['_complex'] = $map;
$m['_string'] = $broMap[1];
$m['_logic'] = 'or';
$map = $m;
}
}
}
} else {
if (is_string($broMap) !== false) {
$map['_string'] .= $broMap;
//自身权限
} else {
if (is_array($broMap)) {
if ($broMap[0]) {
$map['_string'] .= $broMap[0];
//自身权限
}
if ($broMap[1]) {
//转授权限
$map["_logic"] = "and";
$m['_complex'] = $map;
$m['_string'] = $broMap[1];
$m['_logic'] = 'or';
$map = $m;
}
}
}
}
}
}
$model = D($name);
// 视图对象的排序
$viewSign = substr($name, -4);
//.........这里部分代码省略.........
示例3: _list
/**
+----------------------------------------------------------
* 根据表单生成查询条件
* 进行列表过滤
+----------------------------------------------------------
* @access protected
+----------------------------------------------------------
* @param Model $model 数据对象
* @param HashMap $map 过滤条件
* @param string $sortBy 排序
* @param boolean $asc 是否正序
* @param mothed $mothed 针对_list查询完后对返回的数组进行再次处理,所以需要传入一个处理方法名。
* @param module $modules 如果当前传入的$name 是视图的话,是无法用method_exists方法,所以需要多传入一个当前模型名字。
+----------------------------------------------------------
* @return void
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
protected function _list($name, $map, $sortBy = '', $asc = false)
{
//测试点
//dump($map);
$model = D($name);
//排序字段 默认为主键名
if (isset($_REQUEST['orderField'])) {
$order = $_REQUEST['orderField'];
} else {
$order = !empty($sortBy) ? $sortBy : $model->getPk();
}
//排序方式默认按照倒序排列
//接受 sost参数 0 表示倒序 非0都 表示正序
if (isset($_REQUEST['orderDirection'])) {
$sort = $_REQUEST['orderDirection'];
} else {
$sort = $asc ? 'asc' : 'desc';
}
if ($_SESSION['a'] != 1) {
$broMap = Browse::getUserMap($this->getActionName());
if ($broMap) {
if ($map['_string']) {
$map['_string'] .= " and " . $broMap;
} else {
$map['_string'] = $broMap;
}
}
}
/* ***************** 修改 ***************** */
if ($_POST['search_flag'] == 1) {
$this->setAdvancedMap($map);
}
//取得满足条件的记录数
// if($_POST['search_flag'] == 1){
// //获取search模板唯一标示ename
// $ename=$_REQUEST["ename"];
// $search_sql = R("Search/spellSql", array($map, $name,$ename));
// $_POST['search_sql']=$search_sql;
// $count = count($model->query($search_sql));
// }else{
$count = $model->where($map)->count('*');
// }
/* ***************** 修改 ***************** */
//不存在则遍历一遍重新拼装$map来处理视图类型数据
if ($count > 0) {
import("@.ORG.Page");
//创建分页对象
$numPerPage = C('PAGE_LISTROWS');
$dwznumPerPage = C('PAGE_DWZLISTROWS');
if (!empty($_REQUEST['numPerPage'])) {
$numPerPage = $_REQUEST['numPerPage'];
}
if ($_POST["dwzpageNum"] == "") {
$dwznumPerPage = $numPerPage;
}
$p = new Page($count, $numPerPage, '', $dwznumPerPage);
//分页查询数据
if ($_POST['dwzloadhtml']) {
$p->firstRow = $p->firstRow + (intval($_POST['dwzpageNum']) - 1) * $numPerPage;
}
/* ***************** 修改 ***************** */
// if($_POST['search_flag'] == 1){
// if($_POST['export_bysearch']==1){//如果是导出则无分页
// $search_sql .= " ORDER BY `{$_POST['maintable']}`.`$order` $sort";
// }else{
// $search_sql .= " ORDER BY `{$_POST['maintable']}`.`$order` $sort LIMIT {$p->firstRow},{$p->listRows}";
// }
// /* 开启搜索缓存 */
// $md5_sql = md5($search_sql);
// $voList = S($md5_sql);
// //开启搜索缓存
// // if(!$voList){
// // $voList = $model->query($search_sql);
// // S($md5_sql, $voList);
// // }
// //关闭搜索缓存
// $voList = $model->query($search_sql);
// }else{
if ($_POST['export_bysearch'] == 1) {
//如果是导出则无分页
$voList = $model->where($map)->order("`" . $order . "` " . $sort)->select();
//.........这里部分代码省略.........
示例4: _filter
//.........这里部分代码省略.........
//获取有权限查看的角色
$misProjectFlowResource = D('MisProjectFlowResource');
$plists = $misProjectFlowResource->getMyProjectIdList($userid);
foreach ($plists as $k => $v) {
array_push($plist, $v);
}
//删除相同的项目ID
$plist = array_unique($plist);
//根据后台用户,获取角色信息
$roleGroupList = D('RolegroupUser');
$rolegrouplist = $roleGroupList->getRoleGroupByUserId($userid);
foreach ($rolegrouplist as $key => $val) {
$where = array();
$where['outlinelevel'] = 4;
$where['status'] = 1;
$where['_string'] = 'FIND_IN_SET( ' . $val . ',readtaskrole )';
//任务
$mis_project_flow_form = M("mis_project_flow_form");
$worklist = $mis_project_flow_form->where($where)->distinct("projectid")->getField("id,projectid");
if ($worklist) {
foreach ($worklist as $k => $v) {
if ($plist) {
if (!in_array($v, $plist)) {
array_push($plist, $v);
}
} else {
array_push($plist, $v);
}
}
}
}
//删除重复项目ID
$plist = array_unique($plist);
if ($plist) {
$map['projectid'] = array(" in ", $plist);
} else {
$map['projectid'] = array("lt", 0);
}
} else {
if ($model == "MisSalesProjectAllocation") {
//项目分派
$map['operateid'] = 0;
$map['auditState'] = array('lt', 3);
//未审核完毕的
//针对手机端用户做判断
if ($_SESSION[C('USER_AUTH_KEY')]) {
$map['createid'] = $_SESSION[C('USER_AUTH_KEY')];
} else {
if ($_REQUEST['userid']) {
$map['createid'] = $_REQUEST['userid'];
} else {
$map['createid'] = null;
}
}
// 查询当前用户
if ($_SESSION['a'] != 1) {
import("@.ORG.Browse");
$broMap = Browse::getUserMap("MisAutoQzu");
if ($broMap) {
if ($map['_string']) {
if (is_string($broMap) !== false) {
$map['_string'] .= " and " . $broMap;
} else {
if (is_array($broMap)) {
if ($broMap[0]) {
$map['_string'] .= " and " . $broMap;
}
if ($broMap[1]) {
$map["_logic"] = "and";
$m['_complex'] = $map;
$m['_string'] = $broMap[1];
$m['_logic'] = 'or';
$map = $m;
}
}
}
} else {
if (is_string($broMap) !== false) {
$map['_string'] .= $broMap;
} else {
if (is_array($broMap)) {
if ($broMap[0]) {
$map['_string'] .= $broMap;
}
if ($broMap[1]) {
$map["_logic"] = "and";
$m['_complex'] = $map;
$m['_string'] = $broMap[1];
$m['_logic'] = 'or';
$map = $m;
}
}
}
}
}
}
}
}
}
}
示例5: _list
/**
* +----------------------------------------------------------
* 根据表单生成查询条件
* 进行列表过滤
* +----------------------------------------------------------
*
* @access protected
* +----------------------------------------------------------
* @param Model $model
* 数据对象
* @param HashMap $map
* 过滤条件
* @param string $sortBy
* 排序
* @param boolean $asc
* 是否正序
* @param
* echoSql 当等1时, 输出记算行数的sql语名;
* +----------------------------------------------------------
* @return void +----------------------------------------------------------
* @throws ThinkExecption +----------------------------------------------------------
*/
protected function _list($name, $map, $sortBy = '', $asc = true, $countfield = '*', $echoSql = '0', $sortstr = '')
{
// ------首页小模块组合查询的条件------//
if ($_REQUEST['remindMap']) {
$remindMap = base64_decode($_REQUEST['remindMap']);
if ($map['_string']) {
$map['_string'] .= " and " . $remindMap;
} else {
$map['_string'] = $remindMap;
}
$this->assign("remindMap", $_REQUEST['remindMap']);
}
// end
// 查询当前用户
if ($_SESSION['a'] != 1) {
import("@.ORG.Browse");
$broMap = Browse::getUserMap($this->getActionName());
// if ($broMap) {
// if($map['_string']){
// $map['_string'] .= " and " . $broMap;
// }else{
// $map['_string']= $broMap;
// }
// }
if ($broMap) {
if ($map['_string']) {
if (is_string($broMap) !== false) {
$map['_string'] .= " and " . $broMap;
} else {
if (is_array($broMap)) {
if ($broMap[0]) {
$map['_string'] .= " and " . $broMap;
}
if ($broMap[1]) {
$map["_logic"] = "and";
$m['_complex'] = $map;
$m['_string'] = $broMap[1];
$m['_logic'] = 'or';
$map = $m;
}
}
}
} else {
if (is_string($broMap) !== false) {
$map['_string'] .= $broMap;
} else {
if (is_array($broMap)) {
if ($broMap[0]) {
$map['_string'] .= $broMap;
}
if ($broMap[1]) {
$map["_logic"] = "and";
$m['_complex'] = $map;
$m['_string'] = $broMap[1];
$m['_logic'] = 'or';
$map = $m;
}
}
}
}
}
}
if ($_REQUEST['projectid'] && $_REQUEST['projectworkid']) {
$map['projectid'] = $_REQUEST['projectid'];
}
// 获取当前控制器名称
$actionname = $this->getActionName();
// begin
$scdmodel = D('SystemConfigDetail');
// 读取列名称数据(按照规则,应该在index方法里面)
$detailList = $scdmodel->getDetail($actionname);
if ($detailList) {
$this->assign('detailList', $detailList);
}
// 扩展工具栏操作
$toolbarextension = $scdmodel->getDetail($actionname, true, 'toolbar', 'sortnum', 'shows', true);
if ($toolbarextension) {
$this->assign('toolbarextension', $toolbarextension);
//.........这里部分代码省略.........
示例6: _list2
public function _list2($name, $map, $sortBy = '', $asc = false, $group = '', $echoSql = '', $sortstr = '')
{
import('@.ORG.Browse');
//map附加
//提醒条件
if ($_REQUEST['remindMap']) {
$remindMap = base64_decode($_REQUEST['remindMap']);
if ($map['_string']) {
$map['_string'] .= " and " . $remindMap;
} else {
$map['_string'] = $remindMap;
}
}
//权限验证条件
if ($_SESSION['a'] != 1 && $name == $this->getActionName()) {
$broMap = Browse::getUserMap($this->getActionName());
//添加商机特殊数据权限过滤
if ($name == "MisSaleMyBusiness") {
if (!$_POST['isbrows']) {
unset($broMap);
}
}
if ($broMap) {
if ($map['_string']) {
$map['_string'] .= " and " . $broMap;
} else {
$map['_string'] = $broMap;
}
}
}
if ($_REQUEST['projectid'] && $_REQUEST['projectworkid']) {
$map['projectid'] = $_REQUEST['projectid'];
}
$model = D($name);
// 视图对象的排序
$viewSign = substr($name, -4);
if ($viewSign == 'View') {
$viewTables = array_keys($model->viewFields);
$viewTable = $viewTables[0];
$viewOrderBy = $model->viewFields[$viewTable][0];
$order = $viewTable . "." . $viewOrderBy;
} else {
if (isset($_REQUEST['orderField']) && $_REQUEST['orderField']) {
$order = $_REQUEST['orderField'];
//$order="`" .$order."`" ;
} else {
$order = !empty($sortBy) ? $sortBy : $model->getPk();
//$order="`" .$order."`" ;
}
}
//排序方式默认按照倒序排列
//接受 sost参数 0 表示倒序 非0都 表示正序
if (isset($_REQUEST['orderDirection'])) {
$sort = $_REQUEST['orderDirection'];
} else {
$sort = $asc ? 'asc' : 'desc';
}
//特殊处理 字符串排序参数 write by xyz
if ($sortstr) {
$order = $sortstr;
$sort = '';
}
/* ***************** 修改 ***************** */
if ($_POST['search_flag'] == 1) {
$this->setAdvancedMap($map);
}
// '*'
$count = $model->where($map)->count('*');
//trace($model->getLastSql());
if ($group) {
$count = $model->group($group)->where($map)->getField('id', true);
$count = count($count);
}
if ($echoSql == 'count' && $_SESSION['a'] == 1) {
echo $model->getLastSql();
}
//传参开启调式 eagle
/* ***************** 修改 ***************** */
//不存在则遍历一遍重新拼装$map来处理视图类型数据
$str = '';
if ($count > 0) {
import("@.ORG.Page");
//创建分页对象
//分页查询数据
if ($group) {
$voList = $model->group($group)->where($map)->order($order . " " . $sort)->select();
} else {
$voList = $model->where($map)->order($order . " " . $sort)->select();
}
foreach ($voList as $k => $v) {
$str .= $str ? "," . $v['id'] : $v['id'];
}
}
return $str;
}