Commit ae02a343 authored by houdong's avatar houdong

自己的也显示昵称

parent 01d5a01c
...@@ -13,6 +13,7 @@ class IdentityAction extends Action{ ...@@ -13,6 +13,7 @@ class IdentityAction extends Action{
$user['userID'] = cookie("_userID") ? cookie("_userID"):0; $user['userID'] = cookie("_userID") ? cookie("_userID"):0;
$user['userName'] = cookie("_userName") ? cookie("_userName"):''; $user['userName'] = cookie("_userName") ? cookie("_userName"):'';
$user['nick'] = cookie("_nick") ? cookie("_nick"):'';
$auth = cookie('_auth'); $auth = cookie('_auth');
if( $user['userName'] && $user['userID'] == $result['user_id'] ){ if( $user['userName'] && $user['userID'] == $result['user_id'] ){
; ;
...@@ -33,27 +34,27 @@ class IdentityAction extends Action{ ...@@ -33,27 +34,27 @@ class IdentityAction extends Action{
if(empty($user['userID'])){ if(empty($user['userID'])){
$Member = array(); $Member = M("User")->where(['user_id'=>$result['user_id']])->find();
$Member = M("User")->where(array('user_id'=>$result['user_id']))->find(); $data = uc_get_user(['userId'=>$result['user_id']]);
if(empty($Member['user_id'])){ if(empty($Member['user_id'])){
$data = uc_get_user(array('userName'=>$result['user_name'],'userId'=>$result['user_id']));
if(!intval($data['status'])&&intval($data['data']['user_id'])){ if(!intval($data['status'])&&intval($data['data']['user_id'])){
$this->_addUser($data['data']); $this->_addUser($data['data']);
$Member = $data['data'];
} }
} }
//从uc取昵称
$Member = $data['data'];
$user['userID'] = $Member['user_id']; $user['userID'] = $Member['user_id'];
$user['userName'] = $Member['user_name']; $user['userName'] = $Member['user_name'];
$user['nick'] = $Member['nick'];
cookie('_userID', $Member['user_id']); cookie('_userID', $Member['user_id']);
cookie('_userName',$Member['user_name']); cookie('_userName',$Member['user_name']);
cookie('_nick',$Member['nick']);
} }
} }
$this->user = $user; $this->user = $user;
$this->assign(array( $this->assign(['user'=>$this->user]);
'user'=>$this->user
));
} }
......
...@@ -1341,7 +1341,7 @@ class IndexAction extends IdentityAction { ...@@ -1341,7 +1341,7 @@ class IndexAction extends IdentityAction {
public function getMyData(){ public function getMyData(){
$userId = $this->user['userID']; $userId = $this->user['userID'];
$tid=$this->GID.'X'.$userId; $tid=$this->GID.'X'.$userId;
$myData=['userId'=>$userId,'userName'=>$this->user['userName']]; $myData=['userId'=>$userId,'userName'=>$this->user['userName'],'nick'=>$this->user['nick']];
$suffix = D('Userinfo')->getTable($this->GID); $suffix = D('Userinfo')->getTable($this->GID);
$table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a'; $table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a';
......
...@@ -850,7 +850,7 @@ class PkTopAction extends IdentityAction{ ...@@ -850,7 +850,7 @@ class PkTopAction extends IdentityAction{
uc_user_synlogin(array('userId'=>$userId,'userName'=>$userName,'nick'=>'','webId'=>$ucData['web_id'])); uc_user_synlogin(array('userId'=>$userId,'userName'=>$userName,'nick'=>'','webId'=>$ucData['web_id']));
$this->setLogin(array('userId'=>$userId,'userName'=>$userName)); $this->setLogin(array('userId'=>$userId,'userName'=>$userName));
$this->assign(array( $this->assign(array(
'user'=>array('userID'=>$userId,'userName'=>$userName) 'user'=>['userID'=>$userId,'userName'=>$userName,'nick'=>$ucData['nick']]
)); ));
} }
public function setShare($userId,$cfrom=0) { public function setShare($userId,$cfrom=0) {
...@@ -1276,7 +1276,7 @@ class PkTopAction extends IdentityAction{ ...@@ -1276,7 +1276,7 @@ class PkTopAction extends IdentityAction{
public function setMyData(){ public function setMyData(){
$userId = $this->user['userID']; $userId = $this->user['userID'];
if($userId){ if($userId){
$myData=['userId'=>$userId,'userName'=>$this->user['userName']]; $myData=['userId'=>$userId,'userName'=>$this->user['userName'],'nick'=>$this->user['nick']];
$tid=$this->GID.'X'.$userId; $tid=$this->GID.'X'.$userId;
//->cache(true,300) //->cache(true,300)
$tData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->find(); $tData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->find();
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<div class="my-info-data"> <div class="my-info-data">
<span class="span-t">我的战绩</span> <span class="span-t">我的战绩</span>
<div class="head-r-num"> <div class="head-r-num">
<span class="user-head" pId__="{$vo.user_id}" pName__="{$vo.user_name}"> <span class="user-head" >
<img src="{:getPortraitPath($vo['user_id'], 'small', true)}" alt=""> <img src="{:getPortraitPath($myData['user_id'], 'small', true)}" alt="">
</span> </span>
<span class="head-r-t" pId__="{$myData.user_id}" pName="{$myData.userName}">{$myData.userName}</span> <span class="head-r-t" pId__="{$myData.user_id}" pName="{$myData.nick}">{$myData.nick}</span>
</div> </div>
<div class="info-data"> <div class="info-data">
<div class="data"><span class="title">周盈利率:</span> <div class="data"><span class="title">周盈利率:</span>
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
<span class="span-t">我的排名</span> <span class="span-t">我的排名</span>
<div class="head-r-num"> <div class="head-r-num">
<span class="user-head" > <span class="user-head" >
<img src="{:getPortraitPath($vo['user_id'], 'small', true)}" alt=""> <img src="{:getPortraitPath($myData['user_id'], 'small', true)}" alt="">
</span> </span>
<span class="head-r-t" >{$myData.userName}</span> <span class="head-r-t" >{$myData.nick}</span>
</div> </div>
<div class="info-data"> <div class="info-data">
<div class="data"><span class="title">周排行:</span> <div class="data"><span class="title">周排行:</span>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<span class="user-head" pId__="{$vo.user_id}" pName__="{$vo.user_name}"> <span class="user-head" pId__="{$vo.user_id}" pName__="{$vo.user_name}">
<img src="{:getPortraitPath($myData['userId'], 'small', true)}" alt=""> <img src="{:getPortraitPath($myData['userId'], 'small', true)}" alt="">
</span> </span>
<span class="head-r-t" pId__="{$myData.user_id}" pName="{$myData.userName}">{$myData.userName}</span> <span class="head-r-t" pId__="{$myData.user_id}" pName="{$myData.nick}">{$myData.nick}</span>
</div> </div>
<div class="info-data"> <div class="info-data">
<table cellspacing="0" cellpadding="0"> <table cellspacing="0" cellpadding="0">
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
<span class="pm-t"><img src="__PUBLIC__/images/2023/pm-t.png" alt=""></span> <span class="pm-t"><img src="__PUBLIC__/images/2023/pm-t.png" alt=""></span>
<div class="head-r-num"> <div class="head-r-num">
<span class="user-head" pId="{$vo.user_id}" pName="{$vo.user_name}"> <span class="user-head" pId="{$myData.user_id}" pName="{$myData.nick}">
<img src="{:getPortraitPath($myData['userId'], 'small', true)}" alt=""> <img src="{:getPortraitPath($myData['userId'], 'small', true)}" alt="">
</span> </span>
<span class="head-r-t" pId="{$vo.user_id}" pName="{$vo.user_name}">{$myData.userName}</span> <span class="head-r-t" pId="{$myData.user_id}" pName="{$myData.nick}">{$myData.nick}</span>
</div> </div>
<div class="info-data"> <div class="info-data">
<table cellspacing="0" cellpadding="0"> <table cellspacing="0" cellpadding="0">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment