Commit a28cebc7 authored by Shakarim Sapa's avatar Shakarim Sapa

- Изменили паузу перед сокрытием формы

parent c5ae61c7
...@@ -156,13 +156,16 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -156,13 +156,16 @@ class Bid extends \common\components\ActiveRecordModel
public function afterSave($insert, $changedAttributes) public function afterSave($insert, $changedAttributes)
{ {
parent::afterSave($insert, $changedAttributes); parent::afterSave($insert, $changedAttributes);
/** @var User $user */ if (!is_null($this->email)) {
$user = User::find()->where(['email' => $this->email])->one(); /** @var User $user */
if (!is_null($user)) { $user = User::find()->where(['email' => $this->email])->one();
if ($this->blog===false) if (!is_null($user)) {
$user->afterSubscribe(['email' => $this->email], true); if ($this->blog===false)
else $user->afterSubscribe(['email' => $this->email], true);
$user->afterSubscribeToBlog(['email' => $this->email], true); else
$user->afterSubscribeToBlog(['email' => $this->email], true);
}
Yii::$app->cache->set('user_email', $this->email);
} }
} }
} }
...@@ -4,10 +4,12 @@ use yii\helpers\Html; ...@@ -4,10 +4,12 @@ use yii\helpers\Html;
use yii\web\JsExpression; use yii\web\JsExpression;
use common\modules\bids\models\Bid; use common\modules\bids\models\Bid;
$userIsSubscribed = false;
$cacheEmail = Yii::$app->cache->get('user_email');
?> ?>
<div class="subsc_blog"> <div class="subsc_blog">
<h2 class="subsc_blog_title"><?=\Yii::t('form', 'Liked? Subscribe up for updates!')?></h2> <h2 class="subsc_blog_title"><?php var_dump($cacheEmail); ?><?=\Yii::t('form', 'Liked? Subscribe up for updates!')?></h2>
<div class="subsc_blog_txt"><?=\Yii::t('form', 'We will try to publish this section only useful and unique content for the market. Subscription allow to be the first to get notification about fresh articles.')?></div> <div class="subsc_blog_txt"><?=\Yii::t('form', 'We will try to publish this section only useful and unique content for the market. Subscription allow to be the first to get notification about fresh articles.')?></div>
<?php <?php
......
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