本文整理汇总了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);
}
}
}
示例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();
}
}
示例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"]));
}
示例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);
}
}
示例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;
}
示例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"]));
}