Commit f1f3595caf8d8a895dc9152d629d729cf824b3b0
1 parent
5fd01fb4
test
Showing
4 changed files
with
96 additions
and
8 deletions
Show diff stats
common/models/UserInfo.php
@@ -63,10 +63,6 @@ | @@ -63,10 +63,6 @@ | ||
63 | return [ | 63 | return [ |
64 | [ | 64 | [ |
65 | [ | 65 | [ |
66 | - 'contract', | ||
67 | - 'estimate', | ||
68 | - 'purchase', | ||
69 | - 'delivery', | ||
70 | 'is_customer', | 66 | 'is_customer', |
71 | 'is_freelancer', | 67 | 'is_freelancer', |
72 | ], | 68 | ], |
@@ -79,7 +75,6 @@ | @@ -79,7 +75,6 @@ | ||
79 | [ | 75 | [ |
80 | [ | 76 | [ |
81 | 'soft', | 77 | 'soft', |
82 | - 'guarantee', | ||
83 | 'about', | 78 | 'about', |
84 | 'city', | 79 | 'city', |
85 | 'country', | 80 | 'country', |
@@ -95,6 +90,7 @@ | @@ -95,6 +90,7 @@ | ||
95 | [ | 90 | [ |
96 | [ 'prepayment' ], | 91 | [ 'prepayment' ], |
97 | 'number', | 92 | 'number', |
93 | + 'min' => 1, | ||
98 | ], | 94 | ], |
99 | [ | 95 | [ |
100 | [ 'experience' ], | 96 | [ 'experience' ], |
@@ -117,7 +113,6 @@ | @@ -117,7 +113,6 @@ | ||
117 | ], | 113 | ], |
118 | [ | 114 | [ |
119 | [ | 115 | [ |
120 | - 'salary', | ||
121 | 'job', | 116 | 'job', |
122 | ], | 117 | ], |
123 | 'string', | 118 | 'string', |
@@ -127,14 +122,23 @@ | @@ -127,14 +122,23 @@ | ||
127 | [ | 122 | [ |
128 | 'busy', | 123 | 'busy', |
129 | 'member', | 124 | 'member', |
125 | + 'contract', | ||
126 | + 'estimate', | ||
127 | + 'purchase', | ||
128 | + 'delivery', | ||
130 | ], | 129 | ], |
131 | 'boolean', | 130 | 'boolean', |
132 | ], | 131 | ], |
133 | [ | 132 | [ |
134 | - [ 'view_count', 'busy', 'member' ], | 133 | + [ 'view_count', 'busy', 'member', 'salary', 'guarantee', 'prepayment' ], |
135 | 'default', | 134 | 'default', |
136 | 'value' => 0, | 135 | 'value' => 0, |
137 | ], | 136 | ], |
137 | + [ | ||
138 | + ['salary', 'guarantee'], | ||
139 | + 'integer', | ||
140 | + 'min' => 0, | ||
141 | + ], | ||
138 | ]; | 142 | ]; |
139 | } | 143 | } |
140 | 144 |
console/migrations/m160217_092739_currency_table.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | + use yii\db\Migration; | ||
4 | + | ||
5 | + class m160217_092739_currency_table extends Migration | ||
6 | + { | ||
7 | + | ||
8 | + public function up() | ||
9 | + { | ||
10 | + $this->createTable('{{%currency}}', [ | ||
11 | + 'currency_id' => $this->primaryKey(), | ||
12 | + 'name' => $this->string(), | ||
13 | + 'symbol' => $this->string(), | ||
14 | + 'code' => $this->string(3), | ||
15 | + 'rate' => $this->float(4), | ||
16 | + 'date_update' => $this->timestamp()->defaultExpression('NOW()') | ||
17 | + ->notNull(), | ||
18 | + 'is_default' => $this->smallInteger(), | ||
19 | + ]); | ||
20 | + $this->batchInsert('{{%currency}}', [ | ||
21 | + 'currency_id', | ||
22 | + 'name', | ||
23 | + 'symbol', | ||
24 | + 'code', | ||
25 | + 'rate', | ||
26 | + 'is_default', | ||
27 | + ], [ | ||
28 | + [ | ||
29 | + 1, | ||
30 | + 'Доллар США', | ||
31 | + '$', | ||
32 | + 'USD', | ||
33 | + 27.31, | ||
34 | + 0, | ||
35 | + ], | ||
36 | + [ | ||
37 | + 2, | ||
38 | + 'Евро', | ||
39 | + '€', | ||
40 | + 'EUR', | ||
41 | + 30.28, | ||
42 | + 0 | ||
43 | + ], | ||
44 | + [ | ||
45 | + 3, | ||
46 | + 'Украинская гривна', | ||
47 | + '₴', | ||
48 | + 'UAH', | ||
49 | + 1, | ||
50 | + 1, | ||
51 | + ], | ||
52 | + [ | ||
53 | + 4, | ||
54 | + 'Российский рубль', | ||
55 | + '₽', | ||
56 | + 'RUB', | ||
57 | + 0.34, | ||
58 | + 0, | ||
59 | + ], | ||
60 | + ]); | ||
61 | + } | ||
62 | + | ||
63 | + public function down() | ||
64 | + { | ||
65 | + $this->dropTable('{{%currency}}'); | ||
66 | + } | ||
67 | + } |
console/migrations/m160217_093704_add_field_geography_user_info.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +use yii\db\Migration; | ||
4 | + | ||
5 | +class m160217_093704_add_field_geography_user_info extends Migration | ||
6 | +{ | ||
7 | + public function up() | ||
8 | + { | ||
9 | + $this->addColumn('{{%user_info}}', 'geography', $this->text()); | ||
10 | + } | ||
11 | + | ||
12 | + public function down() | ||
13 | + { | ||
14 | + $this->dropColumn('{{%user_info}}', 'geography'); | ||
15 | + } | ||
16 | +} |
frontend/views/accounts/general.php
@@ -117,8 +117,9 @@ | @@ -117,8 +117,9 @@ | ||
117 | <div class="input-blocks"> | 117 | <div class="input-blocks"> |
118 | <?= | 118 | <?= |
119 | $form->field($user_info, 'country')->widget(Select2::classname(), [ | 119 | $form->field($user_info, 'country')->widget(Select2::classname(), [ |
120 | - 'options' => ['placeholder' => 'Выбор страны ...'], | 120 | + 'options' => ['placeholder' => 'Выбор страны ...', ], |
121 | 'pluginOptions' => [ | 121 | 'pluginOptions' => [ |
122 | + 'tags' => true, | ||
122 | 'allowClear' => true, | 123 | 'allowClear' => true, |
123 | 'minimumInputLength' => 3, | 124 | 'minimumInputLength' => 3, |
124 | 'ajax' => [ | 125 | 'ajax' => [ |