Commit a28cebc7 authored by Shakarim Sapa's avatar Shakarim Sapa

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

parent c5ae61c7
......@@ -156,13 +156,16 @@ class Bid extends \common\components\ActiveRecordModel
public function afterSave($insert, $changedAttributes)
{
parent::afterSave($insert, $changedAttributes);
/** @var User $user */
$user = User::find()->where(['email' => $this->email])->one();
if (!is_null($user)) {
if ($this->blog===false)
$user->afterSubscribe(['email' => $this->email], true);
else
$user->afterSubscribeToBlog(['email' => $this->email], true);
if (!is_null($this->email)) {
/** @var User $user */
$user = User::find()->where(['email' => $this->email])->one();
if (!is_null($user)) {
if ($this->blog===false)
$user->afterSubscribe(['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;
use yii\web\JsExpression;
use common\modules\bids\models\Bid;
$userIsSubscribed = false;
$cacheEmail = Yii::$app->cache->get('user_email');
?>
<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>
<?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