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


PHP User::getUidShowName方法代码示例

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


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

示例1: actionUidConcern

    /**
     * 指定用户关注的人
     *
     * @param integer $uid
     */
    public function actionUidConcern($uid)
    {
        $login_uid = ZCommonSessionFun::get_user_id();
        $this->layout = false;
        $uid = intval($uid);
        $this->view->title = User::getUidShowName($uid) . '关注的人';
        $model = new UsersFriends();
        $condition['uid'] = $uid;
        $data = $model->getList($condition, null, $this->pageSize);
        if (isset($_GET['ajax'])) {
            $status = 0;
            $html = '';
            if (isset($_GET[$data['pagination']->pageParam]) && $data['pagination']->pageCount < $_GET[$data['pagination']->pageParam]) {
                $data['models'] = [];
            }
            $my_fans_uids = ZCommonFun::listData($data['models'], 'fuid', 'fuid');
            $concer_data = [];
            if (count($my_fans_uids) > 0) {
                $my_fans_uids_str = implode(',', $my_fans_uids);
                $sql = <<<str

select uf.uid uf_uid,uf.fuid fans /*我关注的人*/,(
select count(id) from users_friends where uid=uf_uid and fuid={$login_uid}
) fans_is_concern_ta /*uf.uid关注了他 */
,(
select count(id) from users_friends where uid={$login_uid} and fuid=uf_uid
)ta_is_concern_fans /* 他关注了uf.uid */
,up.*
from users_friends uf
left join user_profile up on up.uid=uf.uid
where uf.uid in({$my_fans_uids_str} )
group by uf.uid

str;
                $query = new Query();
                $concer_data = $query->createCommand()->setSql($sql)->queryAll();
            }
            //             ZCommonFun::print_r_debug($concer_data);
            //             exit;
            // ZCommonFun::print_r_debug($data);
            foreach ($data['models'] as $key => $row) {
                $ta_url = Yii::$app->urlManager->createUrl(['my/personal-page', 'uid' => $row->fuid]);
                $ta_nickname = User::getDefaultTaNickname();
                $ta_image = User::getDefaultHead_image();
                $ta_intro = User::getDefaultTaIntro();
                $concer_text = '关注';
                $is_find = false;
                foreach ($concer_data as $key2 => $row2) {
                    if ($row->fuid == $row2['uf_uid']) {
                        !empty($row2['nickname']) ? $ta_nickname = $row2['nickname'] : null;
                        !empty($row2['head_image']) ? $ta_image = $row2['head_image'] : null;
                        !empty($row2['intro']) ? $ta_intro = $row2['intro'] : null;
                        if ($row2['fans_is_concern_ta'] && $row2['ta_is_concern_fans']) {
                            $url = '';
                            $concer_text = '相互关注';
                        } else {
                            if ($row2['ta_is_concern_fans']) {
                                $url = '';
                                $concer_text = '已关注';
                            } else {
                                $url = Yii::$app->urlManager->createUrl(['my/concern', 'fuid' => $row->fuid]);
                            }
                        }
                        $is_find = true;
                        break;
                    }
                }
                if (!$is_find) {
                    $url = Yii::$app->urlManager->createUrl(['my/concern', 'fuid' => $row->fuid]);
                }
                $html .= <<<str
                <ul class="list" id="answer-view" style="margin:0;">
           <li class="diy-item"><a
\t\t\t\t\thref="{$ta_url}"
\t\t\t\t\ttarget="_blank">
\t\t\t\t\t\t<figure class="cover">
\t\t\t\t\t\t\t<img src="{$ta_image}"
\t\t\t\t\t\t\t\tclass="tuijian-img">
\t\t\t\t\t\t</figure>
\t\t\t\t\t\t<div class="diy-meta">
            \t\t\t\t<div class="title mui-ellipsis">{$ta_nickname}</div>
            \t\t\t\t<span class="iconfont icon-start-filled5"></span>
            \t\t\t\t<div class="desc mui-ellipsis">{$ta_intro}</div>
            \t\t\t</div>
\t\t\t\t</a>
            \t<a url="{$url}" class="play concern" onclick="concern(this)" data-ui="danger small icon-right">{$concer_text}<i class="iconfont icon-right"></i>
\t</a>
            \t\t\t\t    </li>
                </ul>
str;
            }
            echo $html;
            exit;
        }
        return $this->render('fans', ['uid' => $uid, 'ajax_url' => Yii::$app->urlManager->createUrl(['my/uid-concern', 'uid' => $uid, 'page' => '#page#', 'ajax' => '1'])]);
//.........这里部分代码省略.........
开发者ID:smilehaha,项目名称:bag-test,代码行数:101,代码来源:MyController.php

示例2:

    //点击显示评论
    $(".card-list ").on('click','.line-bottom',function(){
        
        var url = $(this).attr('comment-url');
        $("#box-comment").attr('url',url);
    	$(".ux-popmenu2").show();

    	$( "#txt-to_uid").val($(this).find(".item-main").text());
  	    $( "#txt-to_uid").attr('uid',$(this).attr('uid'));
    });
    $(".comment-button").on('click',function(){
        var url = $(this).attr('url');
        $("#box-comment").attr('url',url);
    	$(".ux-popmenu2").show();
 	    $( "#txt-to_uid").val('<?php 
echo User::getUidShowName($uid);
?>
');
  	    $( "#txt-to_uid").attr('uid','<?php 
echo $uid;
?>
')
    	return false;
    });
});
//取消评论
$(".ux-popmenu2 .close").click(function(){
	$(this).closest(".ux-popmenu2").hide();
});
//评论
$(".ux-popmenu2 .line-bottom").click(function(){
开发者ID:smilehaha,项目名称:bag-test,代码行数:31,代码来源:foot-comment.php

示例3:

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\z\ZCommonFun;
use common\models\Survey;
use common\z\ZCommonSessionFun;
use common\models\User;
/* @var $this yii\web\View */
/* @var $searchModel common\models\SurverySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $row common\models\Survey */
$this->title = '我测过的';
$login_user_showNickname = User::getUidShowName(ZCommonSessionFun::get_user_id());
$this->title = $login_user_showNickname . '的个人主页';
$this->params['breadcrumbs'][] = $this->title;
echo $this->renderFile(__DIR__ . '/../layouts/head.php');
?>

<script type="text/javascript" src="./bag-test/js/jquery-2.1.0.min.js"></script>
<div id="main_body">
    
	
	<?php 
echo $this->renderFile(__DIR__ . '/../layouts/head-top.php');
?>
	
	<section class="s_moreread">
			
			<?php 
echo $this->renderFile(__DIR__ . '/../layouts/header-user.php');
开发者ID:smilehaha,项目名称:bag-test,代码行数:31,代码来源:me-test.php

示例4: isset

    if ($header_user_menu_row == $current_id) {
        ${$header_user_name} = 'selected-page';
    }
}
?>
<div class="user-info">
	<table>
		<tr>
			<td class="td-1">
			     <?php 
echo isset($sessionUser['head_image']) ? '<img width="48" height="48" src="' . $sessionUser['head_image'] . '"/>' : '<i class="fa fa-user user-image  common-color"></i>';
?>
			</td>
			<td class="td-2">
				<h3 class="common-color"><label style="color: #333;">昵称</label><?php 
echo User::getUidShowName(ZCommonSessionFun::get_user_id());
?>
</h3>
				<div>
					创建<sapn class="common-color">
					<?php 
echo $model_SurveyTotal->getMySurveyCount();
?>
					</sapn>个
				</div>
				<div onclick="javascript:window.top.document.location='<?php 
echo Yii::$app->urlManager->createUrl(['my/uid-concern', 'uid' => $sessionUser['uid']]);
?>
'">
					关注<sapn class="common-color"><?php 
echo UsersFriends::get_concern_count(ZCommonSessionFun::get_user_id(), true);
开发者ID:smilehaha,项目名称:bag-test,代码行数:31,代码来源:header-user.php


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