Commit e5de9e74b1fc95feac7c2a1aff46deac8497e3cb
1 parent
94b9b80c
order ip
Showing
4 changed files
with
35 additions
and
1 deletions
Show diff stats
| 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 | + } |
models/Order.php
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