本文整理汇总了PHP中app\models\Users::getOneUserNameById方法的典型用法代码示例。如果您正苦于以下问题:PHP Users::getOneUserNameById方法的具体用法?PHP Users::getOneUserNameById怎么用?PHP Users::getOneUserNameById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Users
的用法示例。
在下文中一共展示了Users::getOneUserNameById方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionView
/**
* Displays a single TrainUsers model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
$model = $this->findModel($id);
$model->trainName = Train::getOneTrainNameById($model->train_id);
$model->userName = Users::getOneUserNameById($model->user_id);
return $this->render('view', ['model' => $model]);
}
示例2: actionView
/**
* Displays a single ActivityUsers model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
$model = $this->findModel($id);
$model->activityName = Activity::getOneActivityNameById($model->activity_id);
$model->userName = Users::getOneUserNameById($model->user_id);
return $this->render('view', ['model' => $model]);
}
示例3: actionIndex
public function actionIndex()
{
$userCount = Users::getAllCount();
$oneNewsPic = News::getOnePicIndexNewsByCategory(2);
$newsA = News::getIndexNewsByCategory(2, 6);
$newsB = News::getIndexNewsByCategory(5, 12);
$newsC = News::getIndexNewsByCategory(7, 5);
$newsF = News::getOnePicIndexNewsByCategory(2);
$newsRegister = TrainUsers::getAllByCount(5);
$newContent = Pages::findOne(9);
if (!empty($newsRegister)) {
foreach ($newsRegister as $key => $val) {
$newsD[$key]['title'] = Users::getOneUserNameById($val['user_id']) . "报名" . Train::getOneTrainNameById($val['train_id']) . "已被录取";
$newsD[$key]['create_time'] = $val['create_time'];
$newsD[$key]['user_id'] = $val['user_id'];
}
}
$newsE = News::getIndexNewsByCategory(6, 5);
$data = ['userCount' => $userCount, 'oneNewsPic' => $oneNewsPic, 'newsA' => $newsA, 'newsB' => $newsB, 'newsC' => $newsC, 'newsD' => $newsD, 'newsE' => $newsE, 'newsF' => $newsF, 'newsRegister' => $newContent];
return $this->render('index', ['data' => $data]);
}
示例4: date
<p class="fr"><a href="javascript:window.print();" class="pre">打印证书</a><a href="javascript:window.close();" class="close">关闭</a></p>
</div>
</div>
<div class="content_box">
<div class="zs_img">
<div class="zsBox">
<p class="pimg80"><img src="/upload/images/users_info/photo/<?php
echo \app\models\UsersInfo::getPhotoByUserId($data['user_id']);
?>
" /></p>
<p class="puName">北京<?php
echo \app\models\Level::getOneLevelNameById($data['level_id'] + 1);
?>
足球教练证书</p>
<p class="pName"><?php
echo \app\models\Users::getOneUserNameById($data['user_id']);
?>
</p>
<p class="psucessBox">成功完成"北京市<?php
echo \app\models\Level::getOneLevelNameById($data['level_id'] + 1);
?>
足球教练员"全部培训课程<span>日期:<?php
echo date('Y年m月d日', strtotime($data['end_date']) - 3600 * 24 * 365);
?>
~ <?php
echo date('Y年m月d日', strtotime($data['end_date']));
?>
</span></p>
<p class="bhBset">编号:<?php
echo $data['certificate_number'];
?>
示例5:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\MessagesUsers */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => '站内消息管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="messages-users-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('删除', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => '确认删除吗?', 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'users_id', 'format' => 'html', 'value' => '<a href="/Admin/users/index?UsersSearch[id]=' . $model->users_id . '" target="_blank" style="width:300px">' . \app\models\Users::getOneUserNameById($model->users_id) . '</a>'], ['attribute' => 'type', 'format' => 'html', 'value' => app\models\Messages::$typeList[$model->type]], ['attribute' => 'content', 'format' => 'html', 'value' => $model->content]]]);
?>
</div>
示例6:
<a href="/Admin/train/index?TrainSearch[id]=<?php
echo $model->train_id;
?>
" target="_blank" style="width:300px"><?php
echo \app\models\Train::getOneTrainNameById($model->train_id);
?>
</a>
<div class="help-block"></div>
</div>
<div class="form-group field-trainusers-username">
<label class="control-label" for="trainusers-username">参与学员:</label>
<a href="/Admin/users/index?UsersSearch[id]=<?php
echo $model->user_id;
?>
" target="_blank" style="width:300px"><?php
echo \app\models\Users::getOneUserNameById($model->user_id);
?>
</a>
<div class="help-block"></div>
</div>
<?php
echo $form->field($model, 'day')->textInput(['style' => 'width:300px']);
?>
<?php
echo $form->field($model, 'status')->dropDownList(\app\models\Attendance::$statusList, ['style' => 'width:100px']);
?>
<div class="form-group">
<?php
示例7: actionRegisterCoach
public function actionRegisterCoach()
{
if (Yii::$app->request->isPost) {
$userId = Yii::$app->user->id;
$credentialsNumber = Yii::$app->request->post('credentials_number');
$certificateNumber = Yii::$app->request->post('certificate_number');
$result = UsersLevel::findOne(['user_id' => $userId, 'certificate_number' => $certificateNumber, 'credentials_number' => $credentialsNumber]);
if (empty($result)) {
throw new ServerErrorHttpException('系统错误,原因:没有您的注册信息,谢谢');
} else {
$levelOrder = Level::getOrderById($result['level_id']);
if ($levelOrder != Yii::$app->user->identity->level_order) {
throw new ServerErrorHttpException('您没有当前级别的注册信息,谢谢');
} else {
if ($result['status'] == 0) {
throw new ServerErrorHttpException('您还没有参加培训,谢谢');
} else {
UsersLevel::updateAll(['status' => 2, 'update_time' => date('Y-m-d H:i:s', time()), 'update_user' => Yii::$app->user->identity->username], ['user_id' => $userId, 'level_id' => $result['level_id']]);
return $this->redirect(['/user/register-coach-success']);
}
}
}
} else {
$userLevelInfo = [];
$isRegister = Yii::$app->request->get('register');
if ($isRegister) {
$userLevelInfo = UsersLevel::findOne(['level_id' => Yii::$app->user->identity->level_id, 'user_id' => Yii::$app->user->id]);
}
$newReg = UsersLevel::getAllByCount(5);
if (!empty($newReg)) {
foreach ($newReg as $key => $val) {
$newRegNews[$key]['title'] = Users::getOneUserNameById($val['user_id']) . "注册" . Level::getOneLevelNameById($val['level_id'] + 1) . "教练员";
$newRegNews[$key]['create_time'] = $val['create_time'];
$newRegNews[$key]['user_id'] = $val['user_id'];
}
}
$regComment = Pages::getContentById(4);
$data = ['newRegNews' => $newRegNews, 'regComment' => $regComment, 'userLevelInfo' => $userLevelInfo];
return $this->render('register-coach', ['data' => $data]);
}
}
示例8: date
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\UsersLevel */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => '用户晋升管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="users-level-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('删除', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'train_id', 'value' => \app\models\Train::getOneTrainNameById($model->train_id)], ['attribute' => 'user_id', 'value' => \app\models\Users::getOneUserNameById($model->user_id)], ['attribute' => 'status', 'value' => \app\models\UsersLevel::getStatusName($model->status)], 'certificate_number', ['attribute' => 'end_date', 'value' => date('Y-m-d', strtotime($model->end_date))], 'district', 'receive_address', 'postcode', ['attribute' => 'photo', 'format' => 'html', 'value' => "<img src='/upload/images/users_info/photo/" . \app\models\UsersInfo::getPhotoByUserId($model->user_id) . "' width=157 height='210'>"], ['attribute' => 'credentials_photo', 'format' => 'html', 'value' => "<img src='/upload/images/users_level/credentials_photo/" . $model->credentials_photo . "' width=500 height='210'>"], ['attribute' => 'level_id', 'value' => \app\models\Level::getOneLevelNameById($model->level_id + 1)], 'create_time', 'update_time', 'update_user']]);
?>
</div>