本文整理匯總了PHP中Utility::getCurrentUserID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utility::getCurrentUserID方法的具體用法?PHP Utility::getCurrentUserID怎麽用?PHP Utility::getCurrentUserID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Utility
的用法示例。
在下文中一共展示了Utility::getCurrentUserID方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadList
/**
* load文件並給與權限判斷
*/
protected static function loadList($p_where = null, $p_order = null, $p_pageIndex = null, $p_pageSize = null, &$p_countThis = null, $isDetail = false)
{
$tmpResult = parent::loadList($p_where, $p_order, $p_pageIndex, $p_pageSize, $p_countThis, $isDetail);
if (is_array($tmpResult) && array_key_exists('errorCode', $tmpResult)) {
return $tmpResult;
}
switch ($auth = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), $isDetail ? 'detail' : 'list', $tmpResult)) {
case 'admin':
//有管理權限
//有管理權限
case 'self':
//作者
break;
case 'normal':
//正常用戶
//正常用戶
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
case 'empty':
//空
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_DATA_EMPTY, '不存在對應數據');
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
PersonModel::$authViewDisabled = static::$authViewDisabledList[$auth];
return $tmpResult;
}
示例2: actionLogOut
/**
* 注銷登錄
* @return [type] [description]
*/
public static function actionLogOut()
{
DeviceController::setDeviceWithUser(Utility::getHeaderValue('Devicetoken'), null);
if (Utility::getCurrentUserID() <= 0) {
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '君未登錄兮,談何注銷哈。');
}
return Utility::getArrayForResults(RUNTIME_CODE_OK, '您已成功退出登錄。');
}
示例3: getLocalNextAction
public function getLocalNextAction()
{
$nextActions = JOB_STATUS::getNextAction(Utility::getCurrentUserID(), $this);
$cancelActions = array();
foreach ($nextActions as $orderAction) {
$strOfOrderStatus = JOB_STATUS::getStrOfStatus($orderAction);
$strOfOrderStatus['nextaction'] = $strOfOrderStatus['status'];
unset($strOfOrderStatus['status']);
unset($strOfOrderStatus['statusStr']);
unset($strOfOrderStatus['statusDescription']);
if ($orderAction == JOB_STATUS::DRAFT) {
$cancelActions[] = $strOfOrderStatus;
} else {
$nextActions[] = $strOfOrderStatus;
}
}
return array('cancelActions' => $cancelActions, 'nextActions' => $nextActions);
}
示例4: actionList
public static function actionList()
{
$p_where['status'] = STATUS_NORMAL;
//默認列表頁隻篩選STATUS_NORMAL狀態的數據
//根據權限不同,支持的篩選功能也可以不同
switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
case 'admin':
//有管理權限
$p_where['status'] = W2HttpRequest::getRequestInt('status');
//管理員可以篩選狀態'
$p_where['userID'] = W2HttpRequest::getRequestInt('uid');
//管理員可以篩選用戶ID'
break;
case 'self':
//作者
$p_where['userID'] = Utility::getCurrentUserID();
break;
case 'normal':
//正常用戶
//正常用戶
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$_order = W2HttpRequest::getRequestString('order', false, '');
switch (strtolower($_order)) {
case 'id':
case 'userid':
//發布用戶ID
//發布用戶ID
case 'status':
//0: 不存在 1: 正常 2: 草稿 3:待審
//0: 不存在 1: 正常 2: 草稿 3:待審
case 'createtime':
//創建時間
//創建時間
case 'modifytime':
//修改時間
$p_order = $_order;
break;
case '':
case 'default':
$p_order = 'id';
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請使用可選的排序方案。');
break;
}
$p_countThis = -1;
return static::aList($p_where, $p_order, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
}
示例5: actionList
public static function actionList()
{
$status = W2HttpRequest::getRequestInt('status');
$p_where = array();
switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
case 'admin':
//有管理權限
$p_where['bossID'] = W2HttpRequest::getRequestInt('userid');
$p_where['status'] = W2HttpRequest::getRequestInt('status', null, true, false, STATUS_NORMAL);
//管理員可以篩選數據狀態
break;
case 'self':
//作者
//作者
case 'normal':
//正常用戶
$p_where['bossID'] = Utility::getCurrentUserID();
if ($status == 0) {
$p_where['status'] = STATUS_NORMAL;
} else {
$p_where['status'] = W2HttpRequest::getRequestInt('status', null, true, false, STATUS_NORMAL);
//用戶可以篩選數據狀態
}
break;
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$_order = W2HttpRequest::getRequestString('order', false, '');
switch (strtolower($_order)) {
case 'id':
case 'userid':
//用戶ID
//用戶ID
case 'bossid':
//技能名稱 認證後不可更改
//技能名稱 認證後不可更改
case 'missionid':
//技能認證日期
//技能認證日期
case 'countdays':
//認證機構
//認證機構
case 'status':
//認證狀態 0未認證 1已認證 2認證失敗
$p_order = $_order;
break;
case '':
case 'default':
$p_order = 'id';
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請使用可選的排序方案。');
break;
}
$p_countThis = -1;
return static::aList($p_where, $p_order, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
}
示例6: actionList
public static function actionList()
{
switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
case 'admin':
//有管理權限
if (Utility::getCurrentUserID('uid') != null) {
$p_where['userid'] = W2HttpRequest::getRequestInt('uid');
}
//管理員可以篩選用戶
if (W2HttpRequest::getRequestInt('jobareaid') != null) {
$p_where['jobareaid'] = W2HttpRequest::getRequestInt('jobareaid');
}
//管理員可以篩選地區
if (W2HttpRequest::getRequestString('jobstartdate') != null) {
$p_where['jobstartdate >= \'%s\''] = W2HttpRequest::getRequestString('jobstartdate');
}
//管理員可以篩選開始時間
if (W2HttpRequest::getRequestString('jobenddate') != null) {
$p_where['jobenddate <= \'%s\''] = W2HttpRequest::getRequestString('jobenddate');
}
//管理員可以篩選結束時間
break;
case 'self':
//作者
//作者
case 'normal':
//正常用戶
$p_where['userID'] = Utility::getCurrentUserID('userid');
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$_order = W2HttpRequest::getRequestString('order', false, '');
switch (strtolower($_order)) {
case 'id':
case 'userid':
//用戶ID
//用戶ID
case 'jobAreaID':
//地區ID
//地區ID
case 'jobStartDate':
//開始時間
//開始時間
case 'jobEndDate':
//結束時間
$p_order = $_order;
break;
case '':
case 'default':
$p_order = 'id';
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請使用可選的排序方案。');
break;
}
$p_countThis = -1;
return static::aList($p_where, $p_order, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
}
示例7: getCurrentUserModel
/**
* [getCurrentUserModel description]
* @return UserModel 用戶
*/
public static function getCurrentUserModel()
{
$_clsHandler = USERHANDLER_NAME;
$tmpModel = $_clsHandler::loadModelById(Utility::getCurrentUserID());
return $tmpModel;
}
示例8: actionList1
public static function actionList1()
{
$p_where = array();
$p_where['status'] = STATUS_NORMAL;
//根據權限不同,支持的篩選功能也可以不同
switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
case 'admin':
//有管理權限
$p_where['status'] = W2HttpRequest::getRequestInt('status');
//管理員可以篩選狀態
//管理員可以篩選狀態
case 'self':
//作者
//作者
case 'normal':
//正常用戶
$fid = W2HttpRequest::getRequestInt('fid');
if (empty($fid)) {
$p_where['fID'] = 0;
} else {
$p_where['fID'] = $fid;
}
$p_where['majorname like \'%%%s%%\''] = W2HttpRequest::getRequestString('majorname');
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$a = MajorHandler::getList($p_where, $content = array());
var_dump($a);
// $p_countThis = -1;
// return static::aList($p_where,$p_order = null,$p_pageIndex=null,$p_pageSize=null,$p_countThis,$isDetail = false);
}
示例9: actionList
public static function actionList()
{
$p_where = array();
$p_where['status'] = STATUS_NORMAL;
//根據權限不同,支持的篩選功能也可以不同
switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
case 'admin':
//有管理權限
$p_where['status'] = W2HttpRequest::getRequestInt('status');
//管理員可以篩選狀態
//管理員可以篩選狀態
case 'self':
//作者
//作者
case 'normal':
//正常用戶
$p_where['areaId'] = W2HttpRequest::getRequestInt('areaId');
//用戶可以篩選地區
$p_where['schoolName like \'%%%s%%\''] = W2HttpRequest::getRequestString('schoolName');
//用戶可以篩選學校
$p_where['jiben'] = W2HttpRequest::getRequestString('jiben');
//用戶可以篩選本科類別
//用戶可以篩選本科類別
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$p_countThis = -1;
return static::aList($p_where, $p_order = null, $p_pageIndex = null, $p_pageSize = null, $p_countThis, $isDetail = false);
}
示例10: actionEvaluationList
public static function actionEvaluationList()
{
$p_where = array();
$p_where['status'] = STATUS_NORMAL;
//默認列表頁隻篩選STATUS_NORMAL狀態的數據
$p_where['missionStatus'] = 31;
//0: 不存在 11: 接受報名並已預付款 21: 確認完成並付款 31:已評價
$p_where['qualityRate'] = W2HttpRequest::getRequestInt('qualityrate');
//服務質量評分
$p_where['manneryRate'] = W2HttpRequest::getRequestInt('manneryrate');
//服務態度評分
$p_where['speedRate'] = W2HttpRequest::getRequestInt('speedrate');
//服務速度評分
$p_where['commentContent'] = W2HttpRequest::getRequestString('commentcontent', false);
//評語留言
$p_where['createTime >= \'%s\''] = W2HttpRequest::getRequestDateTime('createtimestart');
//創建時間
$p_where['createTime < \'%s\''] = W2HttpRequest::getRequestDateTime('createtimeend');
//創建時間
$p_where['modifyTime >= \'%s\''] = W2HttpRequest::getRequestDateTime('modifytimestart');
//修改時間
$p_where['modifyTime < \'%s\''] = W2HttpRequest::getRequestDateTime('modifytimeend');
//修改時間
switch ($auther = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'list')) {
case 'admin':
//有管理權限
$p_where['userID'] = W2HttpRequest::getRequestInt('userid');
//管理員可以篩選用戶ID
$p_where['id in (%s)'] = W2HttpRequest::getRequestArrayString('ids', false, true);
$p_where['id'] = W2HttpRequest::getRequestInt('id');
$p_where['jobID'] = W2HttpRequest::getRequestInt('jobid');
//任務ID
$p_where['status'] = W2HttpRequest::getRequestInt('status', null, true, false, STATUS_NORMAL);
//管理員可以篩選數據狀態
$p_where['missionStatus'] = W2HttpRequest::getRequestInt('missionstatus');
//0: 不存在 11: 接受報名並已預付款 21: 確認完成並付款 31:已評價
//0: 不存在 11: 接受報名並已預付款 21: 確認完成並付款 31:已評價
case 'self':
//作者
//作者
case 'normal':
//正常用戶
if ($auther == 'normal') {
$p_where['userID'] = Utility::getCurrentUserID();
//普通用戶,默認隻能篩選自己名下數據。
}
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$_order = W2HttpRequest::getRequestString('order', false, '');
switch (strtolower($_order)) {
case 'id':
case 'userid':
//用戶ID
//用戶ID
case 'jobid':
//任務ID
//任務ID
case 'bossid':
//雇主ID
//雇主ID
case 'qualityrate':
//服務質量評分
//服務質量評分
case 'manneryrate':
//服務態度評分
//服務態度評分
case 'speedrate':
//服務速度評分
//服務速度評分
case 'commentcontent':
//評語留言
//評語留言
case 'createtime':
//創建時間
//創建時間
case 'modifytime':
//修改時間
$p_order = $_order;
break;
case '':
case 'default':
$p_order = 'id';
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請使用可選的排序方案。');
break;
//.........這裏部分代碼省略.........
示例11: actionPushMessage
public static function actionPushMessage()
{
$results = array();
switch ($auth = static::getAuthIfUserCanDoIt(Utility::getCurrentUserID(), 'push', null)) {
case 'admin':
//有管理權限
$title = W2HttpRequest::getRequestString('title', false);
$content = W2HttpRequest::getRequestString('content', false);
$type = W2HttpRequest::getRequestInt('type', 5, false, 1, 1);
//1單人 2所有人 3所有安卓 4所有ios
$customtype = W2HttpRequest::getRequestInt('customtype');
$customvalue = W2HttpRequest::getRequestString('customvalue');
$deployStatus = W2HttpRequest::getRequestInt('deploystatus', 2, false, 1, 2);
W2PUSH::$DEPLOY_STATUS = $deployStatus;
if ($content == '') {
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請輸入正確的推送內容');
}
// $tag_name = 't'.date('G');
$tag_name = null;
switch ($type) {
case 1:
//1單人
$userID = W2HttpRequest::getRequestInt('userid');
$telephone = W2HttpRequest::getRequestTelephone('telephone', false);
if ($userID != null) {
$results = array_merge($results, DeviceController::pushMessageToUser($userID, $title, $content, $customtype, $customvalue, $tag_name));
} else {
if ($telephone != null) {
$results = array_merge($results, DeviceController::pushMessageToTelephone($telephone, $title, $content, $customtype, $customvalue, $tag_name));
} else {
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請輸入正確的userid 或 telephone');
}
}
break;
case 2:
//2所有人
//2所有人
case 3:
//3所有安卓
$push_type = 2;
// 2部分人(*常用)
$results[] = W2PUSH::pushMessage($push_type, $device_type = 3, $title, $content, $customtype, $customvalue, null, $tag_name);
if ($type == 3) {
break;
}
case 4:
//4所有ios
$push_type = 2;
// 2部分人(*常用)
$results[] = W2PUSH::pushMessage($push_type, $device_type = 4, $title, $content, $customtype, $customvalue, null, $tag_name);
break;
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_PARAM, '請輸入正確的推送類型');
break;
}
break;
case 'self':
//作者
//作者
case 'normal':
//正常用戶
//正常用戶
case 'draft':
//未激活
//未激活
case 'pending':
//待審禁言
//待審禁言
case 'disabled':
//封號
//封號
case 'visitor':
//遊客
//遊客
default:
return Utility::getArrayForResults(RUNTIME_CODE_ERROR_NO_AUTH, '您沒有權限執行該操作');
break;
}
$success_amount_total = 0;
foreach ($results as $ret) {
if (array_key_exists('result', $ret) && array_key_exists('response_params', $ret['result']) && array_key_exists('success_amount', $ret['result']['response_params'])) {
$success_amount_total += $ret['result']['response_params']['success_amount'];
}
}
return Utility::getArrayForResults(RUNTIME_CODE_OK, '', $results, array('success_amount_total' => $success_amount_total));
}