Commit 83cba62cb1e41653de621bd4a3e7de6caa7d85ae
1 parent
6daaaafa
24.02.16
Showing
8 changed files
with
33 additions
and
15 deletions
Show diff stats
common/components/UserCheck.php
... | ... | @@ -16,9 +16,13 @@ class UserCheck implements BootstrapInterface |
16 | 16 | |
17 | 17 | if(\Yii::$app->user->identity instanceof User){ |
18 | 18 | $userInfo = \Yii::$app->user->identity->userInfo; |
19 | - $expression = new Expression('NOW()'); | |
20 | - $userInfo->date_visit = (new \yii\db\Query)->select($expression)->scalar(); | |
21 | - $userInfo->save(); | |
19 | + if($userInfo instanceof UserInfo){ | |
20 | + $expression = new Expression('NOW()'); | |
21 | + $userInfo->date_visit = (new \yii\db\Query)->select($expression)->scalar(); | |
22 | + $userInfo->save(); | |
23 | + } | |
24 | + | |
25 | + | |
22 | 26 | } |
23 | 27 | |
24 | 28 | }); | ... | ... |
common/models/Project.php
... | ... | @@ -173,6 +173,15 @@ |
173 | 173 | ->viaTable('project_payment', [ 'project_id' => 'project_id' ]); |
174 | 174 | } |
175 | 175 | |
176 | + /** | |
177 | + * @return \yii\db\ActiveQuery | |
178 | + */ | |
179 | + public function getParent() | |
180 | + { | |
181 | + return $this->hasOne(self::className(), [ 'project_id' => 'project_pid' ]); | |
182 | + } | |
183 | + | |
184 | + | |
176 | 185 | |
177 | 186 | public function getBudgetCurrency() |
178 | 187 | { | ... | ... |
common/models/User.php
frontend/config/main.php
... | ... | @@ -70,6 +70,7 @@ return [ |
70 | 70 | 'company/portfolio/<company_id:[\w-]+>/<filter:[\d]+>' => 'company/portfolio-filter', |
71 | 71 | 'company/blog-view/<company_id:[\w-]+>/<link:[\w-]+>' => 'company/blog-view', |
72 | 72 | 'company/<action>/<company_id:[\w-]+>' => 'company/<action>', |
73 | + 'tender/view/<tender_id:[\d-]+>' => 'tender/view', | |
73 | 74 | |
74 | 75 | ] |
75 | 76 | ], | ... | ... |
frontend/controllers/SiteController.php
frontend/models/SignupForm.php
... | ... | @@ -59,12 +59,16 @@ class SignupForm extends Model |
59 | 59 | */ |
60 | 60 | public function signup() |
61 | 61 | { |
62 | + | |
62 | 63 | if ($this->validate()) { |
63 | 64 | $user = new User(); |
64 | 65 | $user->username = $this->username; |
66 | + $user->firstname = $this->firstname; | |
67 | + $user->lastname = $this->lastname; | |
65 | 68 | $user->email = $this->email; |
66 | 69 | $user->setPassword($this->password); |
67 | 70 | $user->generateAuthKey(); |
71 | + | |
68 | 72 | if ($user->save()) { |
69 | 73 | return $user; |
70 | 74 | } | ... | ... |
frontend/views/search/_projects_list_view.php
1 | +<?php | |
2 | +use yii\helpers\Html; | |
3 | +use yii\helpers\Url; | |
4 | + | |
5 | +?> | |
1 | 6 | <div class="search-profile-blocks"> |
2 | - <a href="" class="srch-prof-title"><?= $model->name?></a> | |
3 | - <div class="srch-prof-budget"><span></span>Бюджет: <?= $model->budget?> <?= $model->budgetCurrency->label?> (Договорной)</div> | |
7 | + <?= Html::a($model->name, Url::toRoute( ['tender/view','tender_id' =>$model->project_id] )) ?> | |
8 | + <div class="srch-prof-budget"><span></span>Бюджет: <?= $model->budget?> <?= $model->budgetCurrency->label?> (<?= $model->contractual ? "Договорной" : "Не договорной" ?>)</div> | |
4 | 9 | <div class="srch-prof-contract-wr"> |
5 | 10 | <div class="srch-prof-contract-button">ПОДРЯД</div> |
6 | 11 | <div class="srch-prof-contract-txt"> |
7 | - <span>Из проекта: </span><a href="#">Печерский квартал</a> | |
12 | + <?php if(!empty($model->parent->name)):?> | |
13 | + <span>Из проекта: </span><?= Html::a($model->parent->name, Url::toRoute(['tender/view', 'tender_id' =>$model->parent->project_id ])) ?> | |
14 | + <?php endif; ?> | |
8 | 15 | </div> |
9 | 16 | </div> |
10 | 17 | <div class="srch-prof-text"> |
... | ... | @@ -15,7 +22,7 @@ |
15 | 22 | <img src="/images/ico-city.png" alt=""/><span><?= $model->city?></span> |
16 | 23 | </div> |
17 | 24 | <div class="srch-prof-params srch-prof-params-clock"> |
18 | - <img src="/images/ico-clock.png" alt=""/><span><?= $model->end?></span> | |
25 | + <img src="/images/ico-clock.png" alt=""/><span><?= Yii::$app->formatter->asDatetime($model->date_end, 'Y-MM-d')?></span> | |
19 | 26 | </div> |
20 | 27 | <div class="srch-prof-params srch-prof-params-comm"> |
21 | 28 | <img src="/images/ico-comm.png" alt=""/><span>4 предложения</span> | ... | ... |