Commit 2f4c561975e9304f315a273f33ce043cd70a86f1

Authored by alex
1 parent 4d77d202

Добавил кологку для заявки для доктора "Страница перехода",

backend/controllers/VisitController.php
@@ -59,7 +59,11 @@ @@ -59,7 +59,11 @@
59 ], 59 ],
60 'created_at' => [ 60 'created_at' => [
61 'type' => Index::DATETIME_COL, 61 'type' => Index::DATETIME_COL,
62 - ] 62 + ],
  63 + 'request_webpage' =>
  64 + [
  65 + 'type' => Index::STRING_COL
  66 + ]
63 ], 67 ],
64 'model' => Visit::className(), 68 'model' => Visit::className(),
65 'hasLanguage' => false, 69 'hasLanguage' => false,
@@ -99,6 +103,10 @@ @@ -99,6 +103,10 @@
99 'name' => 'created_at', 103 'name' => 'created_at',
100 'type' => Form::STRING, 104 'type' => Form::STRING,
101 ], 105 ],
  106 + [
  107 + 'name' => 'request_webpage',
  108 + 'type' => Form::STRING,
  109 + ],
102 110
103 ], 111 ],
104 ], 112 ],
@@ -183,6 +191,7 @@ @@ -183,6 +191,7 @@
183 'name' => 'updated_at', 191 'name' => 'updated_at',
184 'type' => Form::STRING, 192 'type' => Form::STRING,
185 ], 193 ],
  194 +
186 ]; 195 ];
187 } 196 }
188 197
common/messages/ru/app.php
@@ -102,9 +102,7 @@ return [ @@ -102,9 +102,7 @@ return [
102 'Price list description' =>'Цены на услуги медицинской клиники ABClinik', 102 'Price list description' =>'Цены на услуги медицинской клиники ABClinik',
103 103
104 104
105 -  
106 -  
107 - 105 + 'Request_webpage' => 'Страница перехода',
108 'FIO' =>'ФИО', 106 'FIO' =>'ФИО',
109 'Email' =>'Email', 107 'Email' =>'Email',
110 'Office address' =>'Украина, Киев, ул. Кудрявская, 31/33', 108 'Office address' =>'Украина, Киев, ул. Кудрявская, 31/33',
common/models/Visit.php
@@ -79,7 +79,8 @@ @@ -79,7 +79,8 @@
79 'name', 79 'name',
80 'phone', 80 'phone',
81 'entity', 81 'entity',
82 - 'email' 82 + 'email',
  83 + 'request_webpage'
83 ], 84 ],
84 'string', 85 'string',
85 'max' => 255, 86 'max' => 255,
@@ -100,6 +101,7 @@ @@ -100,6 +101,7 @@
100 'entity' => Yii::t('app', 'Entity'), 101 'entity' => Yii::t('app', 'Entity'),
101 'entity_id' => Yii::t('app', 'Entity ID'), 102 'entity_id' => Yii::t('app', 'Entity ID'),
102 'email' => Yii::t('app', 'Email'), 103 'email' => Yii::t('app', 'Email'),
  104 + 'request_webpage' => Yii::t('app', 'Request_webpage'),
103 ]; 105 ];
104 } 106 }
105 107
console/migrations/m180623_131646_add_request_webpage_column_to_visit_table.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Migration;
  4 +
  5 +/**
  6 + * Handles adding request_webpage to table `visit`.
  7 + */
  8 +class m180623_131646_add_request_webpage_column_to_visit_table extends Migration
  9 +{
  10 + /**
  11 + * {@inheritdoc}
  12 + */
  13 + public function safeUp()
  14 + {
  15 + $this->addColumn('visit', 'request_webpage', $this->string(255));
  16 + }
  17 +
  18 + /**
  19 + * {@inheritdoc}
  20 + */
  21 + public function safeDown()
  22 + {
  23 + $this->dropColumn('visit', 'request_webpage');
  24 + }
  25 +}
frontend/config/main.php
@@ -11,7 +11,6 @@ use yii\helpers\Url; @@ -11,7 +11,6 @@ use yii\helpers\Url;
11 11
12 return [ 12 return [
13 'on beforeRequest' => function () { 13 'on beforeRequest' => function () {
14 -  
15 $pathInfo = Yii::$app->request->pathInfo; 14 $pathInfo = Yii::$app->request->pathInfo;
16 $query = Yii::$app->request->queryString; 15 $query = Yii::$app->request->queryString;
17 if (!empty($pathInfo) && substr($pathInfo, -1) === '/' && substr($pathInfo, 0, 1) !== "/") { 16 if (!empty($pathInfo) && substr($pathInfo, -1) === '/' && substr($pathInfo, 0, 1) !== "/") {
@@ -43,6 +42,7 @@ use yii\helpers\Url; @@ -43,6 +42,7 @@ use yii\helpers\Url;
43 'name', 42 'name',
44 'phone', 43 'phone',
45 'message', 44 'message',
  45 +
46 ], 46 ],
47 'rules' => [ 47 'rules' => [
48 [ 48 [
@@ -153,7 +153,8 @@ use yii\helpers\Url; @@ -153,7 +153,8 @@ use yii\helpers\Url;
153 'email', 153 'email',
154 'comment', 154 'comment',
155 'entity_id', 155 'entity_id',
156 - 'entity' 156 + 'entity',
  157 +
157 ], 158 ],
158 'rules' => [ 159 'rules' => [
159 [ 160 [
@@ -169,7 +170,9 @@ use yii\helpers\Url; @@ -169,7 +170,9 @@ use yii\helpers\Url;
169 'email' => 'Email', 170 'email' => 'Email',
170 'comment' => 'Ваш отзыв', 171 'comment' => 'Ваш отзыв',
171 'entity_id' => false, 172 'entity_id' => false,
172 - 'entity' => false 173 + 'entity' => false,
  174 +
  175 +
173 ], 176 ],
174 177
175 'inputOptions' => [ 178 'inputOptions' => [
@@ -266,7 +269,8 @@ use yii\helpers\Url; @@ -266,7 +269,8 @@ use yii\helpers\Url;
266 'message', 269 'message',
267 270
268 'entity', 271 'entity',
269 - 'entity_id' 272 + 'entity_id',
  273 + 'request_webpage',
270 ], 274 ],
271 'rules' => [ 275 'rules' => [
272 [ 276 [
@@ -282,7 +286,8 @@ use yii\helpers\Url; @@ -282,7 +286,8 @@ use yii\helpers\Url;
282 'phone' => \Yii::t('app','Phone'), 286 'phone' => \Yii::t('app','Phone'),
283 'message' => \Yii::t('app','Message'), 287 'message' => \Yii::t('app','Message'),
284 'entity_id' => false, 288 'entity_id' => false,
285 - 'entity' => false 289 + 'entity' => false,
  290 + 'request_webpage' => false
286 ], 291 ],
287 292
288 'inputOptions' => [ 293 'inputOptions' => [
@@ -292,6 +297,16 @@ use yii\helpers\Url; @@ -292,6 +297,16 @@ use yii\helpers\Url;
292 'entity_id' => [ 297 'entity_id' => [
293 'type' => 'hiddenInput' 298 'type' => 'hiddenInput'
294 ], 299 ],
  300 + 'request_webpage' => [
  301 + 'type' => 'hiddenInput',
  302 + 'options' =>
  303 + [
  304 + #'value' => \Yii::$app->homeUrl,
  305 + # 'value' => 'test 123',
  306 + 'value' => $_SERVER['REQUEST_URI'],
  307 + ],
  308 +
  309 + ],
295 'name' => [ 310 'name' => [
296 'template' => '<div class="input-wr">{input}</div>' 311 'template' => '<div class="input-wr">{input}</div>'
297 ], 312 ],