本文整理匯總了PHP中UserModel::getUserInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserModel::getUserInfo方法的具體用法?PHP UserModel::getUserInfo怎麽用?PHP UserModel::getUserInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserModel
的用法示例。
在下文中一共展示了UserModel::getUserInfo方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bonusExperimentAction
function bonusExperimentAction()
{
Zend_Loader::loadClass('UserModel');
$user_model = new UserModel();
$params = $this->_arrParam;
if ($this->_request->isPost()) {
try {
$user = (object) $user_model->getUserInfo(array("user_id" => $this->_user->user_id, "game_id" => $params["game_id"]));
if ($params["type"] == 1 || $params["type"] == 3) {
// cộng 50 exp
$newExp = $user->experiment + 50;
} else {
if ($params["type"] == 2) {
$newExp = $user->experiment + round($params["money"] / 1000);
} else {
exit;
}
}
if (isset($newExp)) {
$newLevel = $this->__caculateLevel($user->achievement_id, $user->level, $newExp, 1);
$data = array("level" => $newLevel["level"], "experiment" => $newExp, "achievement_id" => $newLevel["capdoId"], "star" => $newLevel["star"]);
$user_model->updateInfo($data, $this->_user->user_id, $params["game_id"]);
$return = array("code" => 1, "content" => array("level" => $newLevel["level"], "experiment" => $newExp, "experiment_recieved" => $newExp - $user->experiment, "achievement" => $newLevel["capdo"], "thangcap" => $newLevel["thangcap"], "star" => $newLevel["star"], "max_star" => $newLevel["max_star"], "level_up" => $newLevel["level_up"]));
}
} catch (Exception $e) {
$return = array("code" => 0, "content" => "Error in server");
}
echo json_encode($return);
}
exit;
}
示例2: newSchoolMessageAction
function newSchoolMessageAction()
{
//從SSO獲取頻道列表,暫時注釋掉從SSO取頻道的過程
$messageModel = new MessageModel();
$result = $messageModel->getSchool();
//如果SSO沒有找到該頻道
if ($result == -1) {
$this->displayJsonUdo(Common_Error::ERROR_SSO_ERROR_SCHOOL);
}
if ($result == -3) {
$this->displayJsonUdo(Common_Error::ERROR_FIRST_UPDATE);
}
//如果沒有新頻道
if ($result == -2) {
$this->displayJsonUdo(Common_Error::ERROR_SCHOOL_NOT_EXISTS);
}
//如果有新頻道,需要獲取所有注冊用戶,並比對是否適合推送給該用戶
/*$userModel = new UserModel();
$user = $userModel->getAllUser();*/
//如果用戶返回有誤
/* if ($user == -1)
$this->displayJsonUdo(Common_Error::ERROR_SSO_ERROR_USER);*/
//print_r($result);
//以下result和user是測試數據
/* $result = array(
0=> array("id"=>1,"city_id"=>3,"name"=>"雙十","title"=>"雙十中學","grade"=>11,"apiUdoUrl"=>"http://112.126.68.99:8520") ,
1=> array("id"=>2,"city_id"=>4,"name"=>"華英","title"=>"華英學校","grade"=>14,"apiUdoUrl"=>"http://112.126.68.99:8520"),
2=> array("id"=>3,"city_id"=>4,"name"=>"三明","title"=>"三明中學","grade"=>21,"apiUdoUrl"=>"http://112.126.68.99:8520"));*/
//對於每一個新頻道,過濾出該頻道適合推薦給的用戶組
$new_array = [];
$userModel = new UserModel();
foreach ($result as $k => $val) {
$temp_array = [];
//獲取到該頻道下有權限訪問的用戶列表
$user = $userModel->getAllUser($val['id']);
if ($user <= 0) {
continue;
}
foreach ($user as $l => $ids) {
//對於用戶群中的某一個id,獲取該用戶的詳細信息
$value = $userModel->getUserInfo($ids);
//print_r($value);
/**
* 檢查用戶條件,當用戶滿足以下條件時,才將該用戶加入推薦列表
* 如果頻道有年級限製,且用戶的年級條件符合,將用戶加入
*/
$grade_filter = 1;
if ($val['grade']) {
switch ($value['grade']) {
case strstr($value['grade'], '小'):
if ($val['grade'] >= 11 && $val['grade'] != 14) {
$grade_filter = 1;
} else {
$grade_filter = 0;
}
break;
case strstr($value['grade'], '初'):
if ($val['grade'] >= 21 && $val['grade'] != 24 || $val['grade'] <= 10) {
$grade_filter = 1;
} else {
$grade_filter = 0;
}
break;
case strstr($value['grade'], '高'):
if ($val['grade'] <= 20) {
$grade_filter = 1;
} else {
$grade_filter = 0;
}
break;
default:
$grade_filter = 1;
break;
}
}
if ($value['provinceId'] && $value['grade'] && $val['cityId'] && ($val['cityId'] == $value['provinceId'] || $val['cityId'] == $value['cityId'] || $val['cityId'] == $value['areaId']) && $grade_filter || $value['provinceId'] && !$value['grade'] && $val['cityId'] && ($val['cityId'] == $value['provinceId'] || $val['cityId'] == $value['cityId'] || $val['cityId'] == $value['areaId']) || !$value['provinceId'] && $value['grade'] && $grade_filter || !$value['provinceId'] && !$value['grade'] || !$val['cityId']) {
$new_array[$k][0] = $val['id'];
$new_array[$k][1] = $val['customerName'];
$new_array[$k][2] = $val['apiUdoUrl'];
if (!$temp_array) {
$temp_array = array($value['id']);
} else {
array_push($temp_array, $value['id']);
}
}
}
$new_array[$k][3] = $temp_array;
}
//print_r($new_array);
//新頻道可以推薦的用戶數組完成,將參數傳給消息推送接口
$title = "UDO微課堂上新頻道啦~~~";
$type = 1;
$messageType = Common_Config::UDO_SCHOOL_MESSAGE_TYPE;
$messageModel = new MessageModel();
//對於每一個頻道,發送頻道上線消息。有多少頻道,發送多少組消息
foreach ($new_array as $k => $val) {
$retry = 0;
$result = -1;
$receiveUserId = $val[3];
$text = "小主," . $val[1] . "新頻道上線啦!點擊進入>>";
//.........這裏部分代碼省略.........
示例3: subAccAction
/**
* 添加子賬戶頁麵
*/
public function subAccAction()
{
$arr = $this->getRequest()->getParams();
print_r($arr);
$uid = safe::filter($arr['uid'], 'int', '');
$user_data = array('id' => $uid, 'username' => '', 'email' => '', 'mobile' => '', 'head_photo' => '', 'status' => 1);
if ($uid) {
$userModel = new UserModel();
$user_data = $userModel->getUserInfo($uid, $this->user_id);
if (empty($user_data)) {
$this->redirect('subAccList');
}
if ($user_data['head_photo'] != '') {
$user_data['head_photo_thumb'] = Thumb::get($user_data['head_photo'], 180, 180);
}
}
$this->getView()->assign('user', $user_data);
}
示例4: getUserStar
/**
* API:獲取星星數
*
* @access public
* @param 無
* @return JsonView 響應json
*/
public function getUserStar($user_id)
{
$userCheckPoint = UserCache::getByKey($user_id, 's_checkpoint_info');
if (!$userCheckPoint) {
$userInfo = UserModel::getUserInfo($user_id);
$userCheckPoint = unserialize($userInfo['s_checkpoint_info']);
}
$star_num = 0;
if ($userCheckPoint && count($userCheckPoint)) {
foreach ($userCheckPoint as $key => $value) {
$star_num = $value['star_num'] + $star_num;
}
}
return $star_num;
}
示例5: isVip
/**
* 判斷是否為動漫vip
*/
protected function isVip($uin)
{
$userModel = new UserModel();
$userInfoArr = $userModel->getUserInfo($uin);
return !empty($userInfoArr) && $userInfoArr[0]["vip_state"] == IS_VIP ? true : false;
}
示例6: iniUserInfo
/**
* API:初始化用戶數據
*
* @access public
* @param 無
* @return JsonView 響應json
*/
public function iniUserInfo($user_id)
{
$userInfo = UserModel::getUserInfo($user_id);
$userInfo['s_checkpoint_info'] = unserialize($userInfo['s_checkpoint_info']);
$userInfo['s_role_info'] = unserialize($userInfo['s_role_info']);
$userInfo['s_general_info'] = unserialize($userInfo['s_general_info']);
$userInfo['s_item_info'] = unserialize($userInfo['s_item_info']);
$userInfo['s_task_info'] = unserialize($userInfo['s_task_info']);
$userInfo['s_achievement_info'] = unserialize($userInfo['s_achievement_info']);
$userInfo['s_login_info'] = unserialize($userInfo['s_login_info']);
UserCache::setAllUserCache($user_id, $userInfo);
return $userInfo;
}