Commit e5de9e74b1fc95feac7c2a1aff46deac8497e3cb

Authored by Anastasia
1 parent 94b9b80c

order ip

migrations/m170620_093957_order_add_ip.php 0 → 100644
  1 +<?php
  2 +
  3 + use yii\db\Migration;
  4 +
  5 + class m170620_093957_order_add_ip extends Migration
  6 + {
  7 + public function safeUp()
  8 + {
  9 + $this->addColumn('order', 'ip', $this->string());
  10 + }
  11 +
  12 + public function safeDown()
  13 + {
  14 + $this->dropColumn('order', 'ip');
  15 + }
  16 +
  17 + /*
  18 + // Use up()/down() to run migration code without a transaction.
  19 + public function up()
  20 + {
  21 +
  22 + }
  23 +
  24 + public function down()
  25 + {
  26 + echo "m170620_093957_order_add_ip cannot be reverted.\n";
  27 +
  28 + return false;
  29 + }
  30 + */
  31 + }
@@ -82,6 +82,7 @@ @@ -82,6 +82,7 @@
82 'address', 82 'address',
83 'comment', 83 'comment',
84 'secondname', 84 'secondname',
  85 + 'ip',
85 ], 86 ],
86 'string', 87 'string',
87 'max' => 255, 88 'max' => 255,
views/order/index.php
@@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
36 'secondname', 36 'secondname',
37 'phone', 37 'phone',
38 'email:email', 38 'email:email',
  39 + 'ip',
39 [ 40 [
40 'attribute' => 'label_id', 41 'attribute' => 'label_id',
41 'value' => 'label.lang.title', 42 'value' => 'label.lang.title',
@@ -51,7 +52,7 @@ @@ -51,7 +52,7 @@
51 return count($model->orderProducts); 52 return count($model->orderProducts);
52 }, 53 },
53 ], 54 ],
54 - 55 +
55 [ 'class' => 'yii\grid\ActionColumn' ], 56 [ 'class' => 'yii\grid\ActionColumn' ],
56 ], 57 ],
57 ] 58 ]
views/order/view.php
@@ -59,6 +59,7 @@ @@ -59,6 +59,7 @@
59 'city', 59 'city',
60 'address', 60 'address',
61 'comment', 61 'comment',
  62 + 'ip',
62 'created_at:datetime', 63 'created_at:datetime',
63 'updated_at:datetime', 64 'updated_at:datetime',
64 'deleted_at:datetime', 65 'deleted_at:datetime',