本文整理匯總了PHP中common\models\User::getDefaultHead_image方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::getDefaultHead_image方法的具體用法?PHP User::getDefaultHead_image怎麽用?PHP User::getDefaultHead_image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common\models\User
的用法示例。
在下文中一共展示了User::getDefaultHead_image方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionList
/**
* Ta與我私信
* 我和某人的消息
*/
public function actionList()
{
$id = Yii::$app->request->get('id', 0);
$ta_uid = Yii::$app->request->get('uid', 0);
$login_uid = ZCommonSessionFun::get_user_id();
$model_Message = new Message();
$data = $model_Message->getTaList($ta_uid, $login_uid, '', ZCommonFun::getPageSize(), null);
isset($data['models'][0]) ?: ($data['models'] = []);
// ZCommonFun::print_r_debug($data);
// exit;
if (count($data['models']) < 1) {
//echo $page,$pageCount;
//超過最後一頁
echo '';
exit;
}
$User = User::findOne($login_uid);
$login_head_image = $User ? $User->getTaShowHead_image() : User::getDefaultHead_image();
$ta_User = User::findOne($ta_uid);
$ta_head_image = $ta_User ? $ta_User->getTaShowHead_image() : User::getDefaultHead_image();
// $this->title = $ta_user_showNickname.'與'.$login_user_showNickname;
foreach ($data['models'] as $key => $model_Message) {
//我發出的
if ($model_Message->from_uid == $login_uid) {
$head_image = $login_head_image;
$class0 = 'imgright';
$class = 'spanright';
} else {
$head_image = $ta_head_image;
$class0 = 'imgleft';
$class = 'spanleft';
}
echo <<<str
<li page="{$data['pagination']->page}" pageCount="{$data['pagination']->pageCount}"><img src="{$head_image}"
\t\t\t\tclass="{$class0}"><span class="{$class}">{$model_Message->content}</span></li>
str;
}
exit;
}
示例2: 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'])]);
//.........這裏部分代碼省略.........
示例3:
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 */
$login_user_showNickname = User::getUidShowName(ZCommonSessionFun::get_user_id());
$ta_user_showNickname = User::getTaUidShowName($uid);
$User = User::findOne(ZCommonSessionFun::get_user_id());
$login_head_image = $User ? $User->getTaShowHead_image() : User::getDefaultHead_image();
$ta_User = User::findOne($uid);
$ta_head_image = $ta_User ? $ta_User->getTaShowHead_image() : User::getDefaultHead_image();
$this->title = $ta_user_showNickname . '與' . $login_user_showNickname;
$this->params['breadcrumbs'][] = $this->title;
echo $this->renderFile(__DIR__ . '/../layouts/head.php');
?>
<style>
.s_moreread{
margin-bottom: 220px;
position: relative;
}
</style>
<script type="text/javascript" src="./bag-test/js/jquery-2.1.0.min.js"></script>
<div id="main_body">
<?php