Commit d89130bfea93750f4ae70d12ed505ebc2821f942
1 parent
43127bab
Main page sort
Showing
2 changed files
with
17 additions
and
7 deletions
Show diff stats
models/Category.php
... | ... | @@ -19,6 +19,7 @@ |
19 | 19 | * @todo Write doc for ArtboxTreeBehavior |
20 | 20 | * @property integer $id |
21 | 21 | * @property integer $sort |
22 | + * @property integer $sort2 | |
22 | 23 | * @property integer $remote_id |
23 | 24 | * @property integer $parent_id |
24 | 25 | * @property string $path |
... | ... | @@ -68,7 +69,7 @@ |
68 | 69 | return [ |
69 | 70 | 'artboxtree' => [ |
70 | 71 | 'class' => ArtboxTreeBehavior::className(), |
71 | - 'keyNameGroup' => NULL, | |
72 | + 'keyNameGroup' => null, | |
72 | 73 | 'keyNamePath' => 'path', |
73 | 74 | ], |
74 | 75 | 'language' => [ |
... | ... | @@ -110,6 +111,7 @@ |
110 | 111 | 'depth', |
111 | 112 | 'product_unit_id', |
112 | 113 | 'sort', |
114 | + 'sort2', | |
113 | 115 | ], |
114 | 116 | 'integer', |
115 | 117 | ], |
... | ... | @@ -138,6 +140,7 @@ |
138 | 140 | 'product_unit_id' => Yii::t('product', 'Product Unit ID'), |
139 | 141 | 'remote_id' => Yii::t('product', 'Remote ID'), |
140 | 142 | 'sort' => Yii::t('product', 'Порядок вывода'), |
143 | + 'sort2' => Yii::t('product', 'Порядок вывода на главной'), | |
141 | 144 | ]; |
142 | 145 | } |
143 | 146 | |
... | ... | @@ -212,7 +215,7 @@ |
212 | 215 | { |
213 | 216 | if (parent::beforeSave($insert)) { |
214 | 217 | |
215 | - if (empty($this->parent_id)) { | |
218 | + if (empty( $this->parent_id )) { | |
216 | 219 | $this->parent_id = 0; |
217 | 220 | } |
218 | 221 | ... | ... |
views/category/_form.php
... | ... | @@ -39,10 +39,14 @@ |
39 | 39 | ) |
40 | 40 | ->label(Yii::t('product', 'Parent category')) ?> |
41 | 41 | |
42 | - <?php | |
43 | - echo $form->field($model, 'sort'); | |
44 | - ?> | |
45 | - | |
42 | + <?php | |
43 | + echo $form->field($model, 'sort'); | |
44 | + ?> | |
45 | + | |
46 | + <?php | |
47 | + echo $form->field($model, 'sort2'); | |
48 | + ?> | |
49 | + | |
46 | 50 | <?= $form->field($model, 'image') |
47 | 51 | ->widget( |
48 | 52 | \kartik\file\FileInput::className(), |
... | ... | @@ -85,7 +89,10 @@ |
85 | 89 | 'gif', |
86 | 90 | 'png', |
87 | 91 | ], |
88 | - 'initialPreview' => !empty( $model->getImageUrl(1, false) ) ? ArtboxImageHelper::getImage( | |
92 | + 'initialPreview' => !empty( $model->getImageUrl( | |
93 | + 1, | |
94 | + false | |
95 | + ) ) ? ArtboxImageHelper::getImage( | |
89 | 96 | $model->getImageUrl(1, false), |
90 | 97 | 'list' |
91 | 98 | ) : '', | ... | ... |