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


PHP UserIdentity::getuserid方法代码示例

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


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

示例1: init

 public function init()
 {
     Yii::log(Yii::app()->getRequest()->getRequestUri(), 'trace', 'API_RAW_REQUEST_URL');
     if (!empty($_GET['code']) && !empty($_GET['state']) && $_GET['state'] == 'wxbutton') {
         $temopenid = WX::getUserWebOpenid($_GET['code']);
         if (!empty($temopenid)) {
             Yii::app()->session['openid'] = $temopenid;
         }
     }
     $this->openid = Yii::app()->session['openid'];
     if (in_array(SERVER_NAME, array('yicheng', 'mac'))) {
         $this->openid = 'opYNAwg9MS6Btoo0cVmvvQLSaoHY';
     }
     $this->user_id = UserIdentity::getuserid($this->openid);
     Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/css/jquery-2.1.4.min.js');
     Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl . '/css/bootstrap/css/bootstrap.css');
     Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/css/bootstrap/js/bootstrap.min.js');
     Yii::app()->clientScript->registerScriptFile("http://res.wx.qq.com/open/js/jweixin-1.0.0.js");
     Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/css/yunba/socket.io-1.3.5.min.js');
     Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/css/yunba/yunba-js-sdk.js');
     $this->signPackage = $this->getSignPackage();
 }
开发者ID:CenturyWarDesign,项目名称:umbrella,代码行数:22,代码来源:BaseController.php

示例2: createOrUpdate

 public static function createOrUpdate($udid)
 {
     $type = 'update';
     $userid = UserIdentity::getuserid($udid);
     $community = Community::model()->findByAttributes(array('user_id' => $userid));
     if (!$community) {
         $community = new Community();
         $type = 'create';
     }
     $userlocate = User::model()->get_locate()->findByPk($userid);
     $community->user_id = $userid;
     $community->begin_time = self::getTime();
     $community->lng = $userlocate->y;
     $community->lat = $userlocate->x;
     $community->type = 1;
     $community->communityid = uniqid("", true);
     $community->des = $userlocate->nickname . "的漂流伞";
     if (!$community->save()) {
         Yii::log(CVarDumper::dumpAsString($community->errors), 'error', 'Community new save error');
     } else {
         BDLbs::createOrUpdate(intval($community->id), $community->des, $community->des, $community->lat, $community->lng, $type);
         return true;
     }
 }
开发者ID:CenturyWarDesign,项目名称:umbrella,代码行数:24,代码来源:CommunityController.php


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