Commit 033f93316b467afbe51d78091db14c550b17d781
1 parent
ea09d15d
09.02.16
Showing
7 changed files
with
37 additions
and
6 deletions
Show diff stats
common/models/User.php
| ... | ... | @@ -271,6 +271,11 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface |
| 271 | 271 | return $this->hasOne(UserInfo::className(), ['user_id' => 'id']); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | + public function getCompanyInfo(){ | |
| 275 | + return $this->hasOne(CompanyInfo::className(), ['user_id' => 'id']); | |
| 276 | + } | |
| 277 | + | |
| 278 | + | |
| 274 | 279 | public function getIsPerformer() |
| 275 | 280 | { |
| 276 | 281 | return true; | ... | ... |
common/models/UserInfo.php
| ... | ... | @@ -67,7 +67,7 @@ class UserInfo extends \yii\db\ActiveRecord |
| 67 | 67 | [['prepayment'], 'number'], |
| 68 | 68 | |
| 69 | 69 | [['rank', 'location'], 'string', 'max' => 50], |
| 70 | - [['salary', 'job','firstname','lastname'], 'string', 'max' => 255], | |
| 70 | + [['salary', 'job'], 'string', 'max' => 255], | |
| 71 | 71 | [['busy', 'member'], 'boolean'], |
| 72 | 72 | ]; |
| 73 | 73 | } | ... | ... |
common/modules/file/controllers/UploaderController.php
| 1 | +<?php | |
| 2 | +namespace frontend\components; | |
| 3 | + | |
| 4 | + | |
| 5 | +use Yii; | |
| 6 | +use yii\base\Component; | |
| 7 | +use yii\base\InvalidConfigException; | |
| 8 | +use common\models\User; | |
| 9 | + | |
| 10 | +class UserInfo extends Component | |
| 11 | +{ | |
| 12 | + public function getUser() | |
| 13 | + { | |
| 14 | + if(\Yii::$app->user->isGuest){ | |
| 15 | + die('guest'); | |
| 16 | + } else { | |
| 17 | + return User::findOne(\Yii::$app->user->id); | |
| 18 | + } | |
| 19 | + | |
| 20 | + } | |
| 21 | + | |
| 22 | +} | |
| 0 | 23 | \ No newline at end of file | ... | ... |
frontend/config/main.php
frontend/controllers/PerformerController.php
| ... | ... | @@ -30,8 +30,6 @@ class PerformerController extends Controller |
| 30 | 30 | { |
| 31 | 31 | public $layout = 'performer'; |
| 32 | 32 | |
| 33 | - public $defaultAction = 'common'; | |
| 34 | - | |
| 35 | 33 | /** |
| 36 | 34 | * @inheritdoc |
| 37 | 35 | */ |
| ... | ... | @@ -50,7 +48,7 @@ class PerformerController extends Controller |
| 50 | 48 | |
| 51 | 49 | public function actionIndex() |
| 52 | 50 | { |
| 53 | - $this->redirect(['site/index']); | |
| 51 | + return $this->render('common'); | |
| 54 | 52 | } |
| 55 | 53 | |
| 56 | 54 | public function actionCommon(/*$performer_id*/) | ... | ... |
frontend/views/layouts/performer.php
| ... | ... | @@ -6,9 +6,10 @@ use yii\widgets\Menu; |
| 6 | 6 | \frontend\assets\AppAsset::register($this); |
| 7 | 7 | /* @var $content string */ |
| 8 | 8 | $this->beginContent('@app/views/layouts/main.php'); |
| 9 | + | |
| 9 | 10 | ?> |
| 10 | 11 | <div class="section-box content"> |
| 11 | - <div class="section-box-16" style="background: url('/images/blog/box-16.jpg') no-repeat"> | |
| 12 | + <div class="section-box-16" style="background: url('<?= Yii::$app->user->identity->userInfo->poster;?>') no-repeat"> | |
| 12 | 13 | <div class="box-wr"> |
| 13 | 14 | <div class="box-all"> |
| 14 | 15 | <div class="blog-buttons-wr style"> | ... | ... |