<?php use yii\helpers\Html; use yii\helpers\Url; use yii\widgets\ActiveForm; use backend\models\student\Students; $user_id = '1'; $student = Students::HeaderInfo($user_id); ?> <div class="mt_ri_1"> <div class="mt_rt" id="topmenus"> <ul> <li class="img"> <?php if ($student['stu_avatar']) { ?> <img src="<?php echo Html::encode($student['stu_avatar']); ?> " height="100" width="100"> <?php } else { ?> <img src="/public/images/us.jpg" height="100" width="100"> <?php } ?> </li> <li class="wi1"> <h1><?php
public function actionBalance() { //获取用户id $session = Yii::$app->session->get('userinfo'); $user_id = $session['user_id']; $Students = new Students(); $student = $Students->HeaderInfo($user_id); $Payment = new Payment(); $pagination = new Pagination(['defaultPageSize' => 8, 'totalCount' => $Payment->Count($user_id)]); $PayList = $Payment->PayList($user_id, $pagination); return $this->render('balance', ['pagination' => $pagination, 'student' => $student, 'paylist' => $PayList]); }