Commit 2f4c561975e9304f315a273f33ce043cd70a86f1

Authored by alex
1 parent 4d77d202

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

backend/controllers/VisitController.php
... ... @@ -59,7 +59,11 @@
59 59 ],
60 60 'created_at' => [
61 61 'type' => Index::DATETIME_COL,
62   - ]
  62 + ],
  63 + 'request_webpage' =>
  64 + [
  65 + 'type' => Index::STRING_COL
  66 + ]
63 67 ],
64 68 'model' => Visit::className(),
65 69 'hasLanguage' => false,
... ... @@ -99,6 +103,10 @@
99 103 'name' => 'created_at',
100 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 191 'name' => 'updated_at',
184 192 'type' => Form::STRING,
185 193 ],
  194 +
186 195 ];
187 196 }
188 197  
... ...
common/messages/ru/app.php
... ... @@ -102,9 +102,7 @@ return [
102 102 'Price list description' =>'Цены на услуги медицинской клиники ABClinik',
103 103  
104 104  
105   -
106   -
107   -
  105 + 'Request_webpage' => 'Страница перехода',
108 106 'FIO' =>'ФИО',
109 107 'Email' =>'Email',
110 108 'Office address' =>'Украина, Киев, ул. Кудрявская, 31/33',
... ...
common/models/Visit.php
... ... @@ -79,7 +79,8 @@
79 79 'name',
80 80 'phone',
81 81 'entity',
82   - 'email'
  82 + 'email',
  83 + 'request_webpage'
83 84 ],
84 85 'string',
85 86 'max' => 255,
... ... @@ -100,6 +101,7 @@
100 101 'entity' => Yii::t('app', 'Entity'),
101 102 'entity_id' => Yii::t('app', 'Entity ID'),
102 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 11  
12 12 return [
13 13 'on beforeRequest' => function () {
14   -
15 14 $pathInfo = Yii::$app->request->pathInfo;
16 15 $query = Yii::$app->request->queryString;
17 16 if (!empty($pathInfo) && substr($pathInfo, -1) === '/' && substr($pathInfo, 0, 1) !== "/") {
... ... @@ -43,6 +42,7 @@ use yii\helpers\Url;
43 42 'name',
44 43 'phone',
45 44 'message',
  45 +
46 46 ],
47 47 'rules' => [
48 48 [
... ... @@ -153,7 +153,8 @@ use yii\helpers\Url;
153 153 'email',
154 154 'comment',
155 155 'entity_id',
156   - 'entity'
  156 + 'entity',
  157 +
157 158 ],
158 159 'rules' => [
159 160 [
... ... @@ -169,7 +170,9 @@ use yii\helpers\Url;
169 170 'email' => 'Email',
170 171 'comment' => 'Ваш отзыв',
171 172 'entity_id' => false,
172   - 'entity' => false
  173 + 'entity' => false,
  174 +
  175 +
173 176 ],
174 177  
175 178 'inputOptions' => [
... ... @@ -266,7 +269,8 @@ use yii\helpers\Url;
266 269 'message',
267 270  
268 271 'entity',
269   - 'entity_id'
  272 + 'entity_id',
  273 + 'request_webpage',
270 274 ],
271 275 'rules' => [
272 276 [
... ... @@ -282,7 +286,8 @@ use yii\helpers\Url;
282 286 'phone' => \Yii::t('app','Phone'),
283 287 'message' => \Yii::t('app','Message'),
284 288 'entity_id' => false,
285   - 'entity' => false
  289 + 'entity' => false,
  290 + 'request_webpage' => false
286 291 ],
287 292  
288 293 'inputOptions' => [
... ... @@ -292,6 +297,16 @@ use yii\helpers\Url;
292 297 'entity_id' => [
293 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 310 'name' => [
296 311 'template' => '<div class="input-wr">{input}</div>'
297 312 ],
... ...