Commit fd0b3782 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавили условие для вывода формы

parent a28cebc7
...@@ -6,10 +6,13 @@ use yii\web\JsExpression; ...@@ -6,10 +6,13 @@ use yii\web\JsExpression;
use common\modules\bids\models\Bid; use common\modules\bids\models\Bid;
$userIsSubscribed = false; $userIsSubscribed = false;
$cacheEmail = Yii::$app->cache->get('user_email'); $cacheEmail = Yii::$app->cache->get('user_email');
if ($cacheEmail!==false && Bid::find()->where(['email' => $cacheEmail])->exists()===true)
$userIsSubscribed = true;
?> ?>
<?php if ($userIsSubscribed===true): ?>
<div class="subsc_blog"> <div class="subsc_blog">
<h2 class="subsc_blog_title"><?php var_dump($cacheEmail); ?><?=\Yii::t('form', 'Liked? Subscribe up for updates!')?></h2> <h2 class="subsc_blog_title"><?=\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
...@@ -59,3 +62,4 @@ $cacheEmail = Yii::$app->cache->get('user_email'); ...@@ -59,3 +62,4 @@ $cacheEmail = Yii::$app->cache->get('user_email');
}, 1500); }, 1500);
}); });
</script> </script>
<?php endif; ?>
\ No newline at end of file
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