本文整理匯總了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;
}