Commit f795c069 authored by difox's avatar difox

Fix school link

parent 83b88423
...@@ -94,10 +94,11 @@ class UserEAuth extends \common\components\ActiveRecordModel ...@@ -94,10 +94,11 @@ class UserEAuth extends \common\components\ActiveRecordModel
$model = User::findByUsername($socialProfile['email']); $model = User::findByUsername($socialProfile['email']);
// Assign service token // Assign service token
$modelEAuth = $model->eauth; $modelEAuth = $model->eauth ? $model->eauth : new UserEauth();
$modelEAuth->user_id = $model->user_id;
$modelEAuth->{$eauthField} = $socialProfile['id']; $modelEAuth->{$eauthField} = $socialProfile['id'];
$modelEAuth->update(false, [$eauthField]); $modelEAuth->update(false, [$eauthField]);
echo '<pre>'; die(var_dump($model)); echo '</pre>';
return $model; return $model;
} }
else { else {
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
</div> </div>
</div> </div>
</section> </section>
<?php if (Yii::$app->user->isGuest): ?>
<section class="sh_ft"> <section class="sh_ft">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
...@@ -75,6 +76,8 @@ ...@@ -75,6 +76,8 @@
</div> </div>
</div> </div>
</section> </section>
<?php endif ?>
<div class="tr_foot"></div> <div class="tr_foot"></div>
<footer> <footer>
<div class="container"> <div class="container">
......
...@@ -556,7 +556,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -556,7 +556,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
public function isUserEmailExists($email) public function isUserEmailExists($email)
{ {
return (bool)static::find(['email' => $email])->count(); return (bool)static::find()->where('email = :email', [':email'=>$email])->count();
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment