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