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


PHP StringUtil::getUid方法代码示例

本文整理汇总了PHP中StringUtil::getUid方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::getUid方法的具体用法?PHP StringUtil::getUid怎么用?PHP StringUtil::getUid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringUtil的用法示例。


在下文中一共展示了StringUtil::getUid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionPost

 public function actionPost()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $return = array("data" => Ibos::lang("Operation succeed", "message"), "IsSuccess" => true);
         if (empty($_POST["touid"])) {
             $return["data"] = Ibos::lang("Message receiver cannot be empty");
             $return["IsSuccess"] = false;
             $this->ajaxReturn($return);
         }
         if (trim(StringUtil::filterCleanHtml($_POST["content"])) == "") {
             $return["data"] = Ibos::lang("Message content cannot be empty");
             $return["IsSuccess"] = false;
             $this->ajaxReturn($return);
         }
         $_POST["touid"] = implode(",", StringUtil::getUid($_POST["touid"]));
         if (isset($_POST["type"])) {
             !in_array($_POST["type"], array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT)) && ($_POST["type"] = null);
         } else {
             $_POST["type"] = null;
         }
         $_POST["content"] = StringUtil::filterDangerTag($_POST["content"]);
         $res = MessageContent::model()->postMessage($_POST, Yii::app()->user->uid);
         if ($res) {
             $this->ajaxReturn($return);
         } else {
             $return["IsSuccess"] = false;
             $return["data"] = MessageContent::model()->getError("message");
             $this->ajaxReturn($return);
         }
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:31,代码来源:PmController.php

示例2: setPosition

 public static function setPosition($positionId, $users)
 {
     $oldUids = User::model()->fetchUidByPosId($positionId, false);
     $userId = explode(",", trim($users, ","));
     $newUids = StringUtil::getUid($userId);
     $delDiff = array_diff($oldUids, $newUids);
     $addDiff = array_diff($newUids, $oldUids);
     if (!empty($addDiff) || !empty($delDiff)) {
         $updateUser = false;
         $userData = self::loadUser();
         if ($addDiff) {
             foreach ($addDiff as $newUid) {
                 $record = $userData[$newUid];
                 if (empty($record["positionid"])) {
                     User::model()->modify($newUid, array("positionid" => $positionId));
                     $updateUser = true;
                 } elseif (strcmp($record["positionid"], $positionId) !== 0) {
                     PositionRelated::model()->add(array("positionid" => $positionId, "uid" => $newUid), false, true);
                 }
             }
         }
         if ($delDiff) {
             foreach ($delDiff as $diffId) {
                 $record = $userData[$diffId];
                 PositionRelated::model()->delete("`positionid` = :positionid AND `uid` = :uid", array(":positionid" => $positionId, ":uid" => $diffId));
                 if (strcmp($positionId, $record["positionid"]) == 0) {
                     User::model()->modify($diffId, array("positionid" => 0));
                     $updateUser = true;
                 }
             }
         }
         $mainNumber = User::model()->count("`positionid` = :positionid", array(":positionid" => $positionId));
         $auxiliaryNumber = PositionRelated::model()->countByPositionId($positionId);
         Position::model()->modify($positionId, array("number" => (int) $mainNumber + $auxiliaryNumber));
         $updateUser && CacheUtil::update("users");
         OrgUtil::update();
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:38,代码来源:UserUtil.php

示例3: dealWithSpecialParams

 protected function dealWithSpecialParams()
 {
     $_POST["upuid"] = implode(",", StringUtil::getUid($_POST["upuid"]));
     $_POST["deptid"] = implode(",", StringUtil::getId($_POST["deptid"]));
     $_POST["positionid"] = implode(",", StringUtil::getId($_POST["positionid"]));
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:6,代码来源:UserController.php

示例4: mergeSearchCondition

 public static function mergeSearchCondition($search, $uid)
 {
     $condition = "(eb.fromid = {$uid} OR e.toid = {$uid})";
     $keyword = stripcslashes($search["keyword"]);
     $pos = isset($search["pos"]) ? $search["pos"] : "all";
     $folder = isset($search["folder"]) ? $search["folder"] : 0;
     $setAttach = isset($search["attachment"]) && $search["attachment"] !== "-1";
     if ($folder == "allbynoarchive") {
         $queryArchiveId = 0;
         $folder = 0;
     } elseif ($folder == "all") {
         $ids = Yii::app()->setting->get("setting/emailtableids");
         $queryArchiveId = $ids;
         $folder = 0;
     } elseif (strpos($folder, "archive_") !== false) {
         $queryArchiveId = intval(preg_replace("/^archive_(\\d+)/", "", $folder));
         $folder = 0;
     } else {
         $queryArchiveId = 0;
         $folder = intval($folder);
     }
     if (!empty($keyword)) {
         $allPos = $pos == "all";
         $posWhereJoin = $allPos ? " OR " : " AND ";
         $posWhere = "";
         if ($pos == "content" || !empty($pos)) {
             if ($pos == "subject" || $allPos) {
                 $posWhere .= $posWhereJoin . "eb.subject LIKE '%{$keyword}%'";
             }
             if ($pos == "content" || $allPos) {
                 $posWhere .= $posWhereJoin . "eb.content LIKE '%{$keyword}%'";
             }
             if ($pos == "attachment" || $allPos) {
                 $containAttach = isset($search["attachment"]) && $search["attachment"] !== "0";
                 if ($containAttach) {
                     $kwBodyIds = Email::model()->fetchAllBodyIdByKeywordFromAttach($keyword, $condition, $queryArchiveId);
                     if (0 < count($kwBodyIds)) {
                         $posWhere .= $posWhereJoin . "FIND_IN_SET(eb.bodyid,'" . implode(",", $kwBodyIds) . "')";
                     } else {
                         return array("condition" => "1=0", "archiveId" => $queryArchiveId);
                     }
                 } else {
                     return array("condition" => "1=0", "archiveId" => $queryArchiveId);
                 }
             }
             if ($allPos) {
                 $condition .= " AND (" . preg_replace("/^" . $posWhereJoin . "/", "", $posWhere) . ")";
             } else {
                 $condition .= $posWhere;
             }
         }
         if ($folder) {
             if ($folder == 1) {
                 $condition .= " AND (e.fid = 1 AND e.isdel = 0)";
             } elseif ($folder == 3) {
                 $condition .= " AND (eb.issend = 1 AND eb.issenderdel != 1 AND e.isweb=0)";
             } else {
                 $condition .= " AND (e.fid = {$folder} AND e.isdel = 0)";
             }
         }
         if (isset($search["dateRange"]) && $search["dateRange"] !== "-1") {
             $dateRange = intval($search["dateRange"]);
             $endTime = TIMESTAMP;
             $startTime = strtotime("- {$dateRange}day", $endTime);
             $condition .= " AND (eb.sendtime BETWEEN {$startTime} AND {$endTime})";
         }
         if (isset($search["readStatus"]) && $search["readStatus"] !== "-1") {
             $readStatus = intval($search["readStatus"]);
             $condition .= " AND e.isread = {$readStatus}";
         }
         if ($setAttach) {
             if ($search["attachment"] == "0") {
                 $condition .= " AND eb.attachmentid = ''";
             } elseif ($search["attachment"] == "1") {
                 $condition .= " AND eb.attachmentid != ''";
             }
         }
         if (isset($search["sender"]) && !empty($search["sender"])) {
             $sender = StringUtil::getUid($search["sender"]);
             $condition .= " AND eb.fromid = " . implode(",", $sender);
         }
         if (isset($search["recipient"]) && !empty($search["recipient"])) {
             $recipient = StringUtil::getUid($search["recipient"]);
             $condition .= " AND e.toid = " . implode(",", $recipient);
         }
         return array("condition" => $condition, "archiveId" => $queryArchiveId);
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:88,代码来源:EmailUtil.php

示例5: getProcessUserList

 protected function getProcessUserList($flowID, $processID = 0, $value = "", $single = false)
 {
     $autoValue = "";
     $ids = array();
     if ($single) {
         $process = FlowProcess::model()->fetchProcess($flowID, $processID);
         $this->getProcessUser($process, $ids);
     } else {
         $allProcess = FlowProcess::model()->fetchAllByFlowId($flowID);
         foreach ($allProcess as $process) {
             $this->getProcessUser($process, $ids);
         }
     }
     if (!empty($ids)) {
         $uids = StringUtil::getUid($ids);
         foreach (User::model()->fetchAllByUids($uids) as $user) {
             $selected = $value == $user["uid"] ? "selected" : "";
             $autoValue .= "<option {$selected} value='" . $user["uid"] . "'>" . $user["realname"] . "</option>";
         }
     }
     return $autoValue;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:22,代码来源:ICViewProcessor.php

示例6: dealWithSpecialParams

 protected function dealWithSpecialParams()
 {
     $_POST["manager"] = implode(",", StringUtil::getUid($_POST["manager"]));
     $_POST["leader"] = implode(",", StringUtil::getUid($_POST["leader"]));
     $_POST["subleader"] = implode(",", StringUtil::getUid($_POST["subleader"]));
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:6,代码来源:DepartmentController.php


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