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


PHP UserModel::getUserInfo方法代码示例

本文整理汇总了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;
 }
开发者ID:backviet01,项目名称:zegome-service,代码行数:31,代码来源:IndexController.php

示例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] . "新频道上线啦!点击进入>>";
//.........这里部分代码省略.........
开发者ID:krisrita,项目名称:udo,代码行数:101,代码来源:Message.php

示例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);
 }
开发者ID:weipinglee,项目名称:nn2,代码行数:21,代码来源:Ucenter.php

示例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;
 }
开发者ID:YYLP,项目名称:y_game,代码行数:22,代码来源:GameAction.class.php

示例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;
 }
开发者ID:Resolut1on,项目名称:My-Project,代码行数:9,代码来源:EventBase.class.php

示例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;
 }
开发者ID:YYLP,项目名称:y_game,代码行数:20,代码来源:UserAction.class.php


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