@@ -13,65 +13,65 @@ discard block |
||
13 | 13 | |
14 | 14 | class Delivery extends \Model { |
15 | 15 | |
16 | - public static $objectName = 'Доставка'; |
|
17 | - public static $cols = [ |
|
18 | - //Основные параметры |
|
19 | - 'name' => ['type' => 'text'], |
|
20 | - 'price' => ['type' => 'decimal'], |
|
21 | - 'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'], |
|
22 | - 'price_text' => ['type' => 'textarea'], |
|
23 | - 'max_cart_price' => ['type' => 'decimal'], |
|
24 | - 'icon_file_id' => ['type' => 'image'], |
|
25 | - 'info' => ['type' => 'html'], |
|
26 | - 'disabled' => ['type' => 'bool'], |
|
27 | - //Системные |
|
28 | - 'weight' => ['type' => 'number'], |
|
29 | - 'date_create' => ['type' => 'dateTime'], |
|
30 | - //Менеджеры |
|
31 | - 'field' => ['type' => 'dataManager', 'relation' => 'fields'], |
|
32 | - 'priceChanger' => ['type' => 'dataManager', 'relation' => 'prices'] |
|
33 | - ]; |
|
34 | - public static $labels = [ |
|
35 | - 'name' => 'Название', |
|
36 | - 'price' => 'Стоимость', |
|
37 | - 'price_text' => 'Текстовое описание стоимости (отображается вместо цены)', |
|
38 | - 'max_cart_price' => 'Басплатно при', |
|
39 | - 'icon_file_id' => 'Иконка', |
|
40 | - 'currency_id' => 'Валюта', |
|
41 | - 'info' => 'Дополнительная информация', |
|
42 | - 'priceChanger' => 'Градация стоимости', |
|
43 | - 'field' => 'Поля', |
|
44 | - 'disabled' => 'Отключено', |
|
45 | - ]; |
|
46 | - public static $dataManagers = [ |
|
47 | - 'manager' => [ |
|
48 | - 'name' => 'Варианты доставки', |
|
49 | - 'cols' => [ |
|
50 | - 'name', |
|
51 | - 'price', |
|
52 | - 'currency_id', |
|
53 | - 'max_cart_price', |
|
54 | - 'disabled', |
|
55 | - 'field', |
|
56 | - 'priceChanger', |
|
57 | - ], |
|
58 | - 'sortMode' => true |
|
59 | - ], |
|
60 | - ]; |
|
61 | - public static $forms = [ |
|
62 | - 'manager' => [ |
|
63 | - 'map' => [ |
|
64 | - ['name', 'disabled'], |
|
65 | - ['max_cart_price', 'icon_file_id'], |
|
66 | - ['price', 'currency_id'], |
|
67 | - ['price_text'], |
|
68 | - ['info'], |
|
69 | - ['priceChanger'], |
|
70 | - ['field'] |
|
71 | - ] |
|
72 | - ]]; |
|
16 | + public static $objectName = 'Доставка'; |
|
17 | + public static $cols = [ |
|
18 | + //Основные параметры |
|
19 | + 'name' => ['type' => 'text'], |
|
20 | + 'price' => ['type' => 'decimal'], |
|
21 | + 'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'], |
|
22 | + 'price_text' => ['type' => 'textarea'], |
|
23 | + 'max_cart_price' => ['type' => 'decimal'], |
|
24 | + 'icon_file_id' => ['type' => 'image'], |
|
25 | + 'info' => ['type' => 'html'], |
|
26 | + 'disabled' => ['type' => 'bool'], |
|
27 | + //Системные |
|
28 | + 'weight' => ['type' => 'number'], |
|
29 | + 'date_create' => ['type' => 'dateTime'], |
|
30 | + //Менеджеры |
|
31 | + 'field' => ['type' => 'dataManager', 'relation' => 'fields'], |
|
32 | + 'priceChanger' => ['type' => 'dataManager', 'relation' => 'prices'] |
|
33 | + ]; |
|
34 | + public static $labels = [ |
|
35 | + 'name' => 'Название', |
|
36 | + 'price' => 'Стоимость', |
|
37 | + 'price_text' => 'Текстовое описание стоимости (отображается вместо цены)', |
|
38 | + 'max_cart_price' => 'Басплатно при', |
|
39 | + 'icon_file_id' => 'Иконка', |
|
40 | + 'currency_id' => 'Валюта', |
|
41 | + 'info' => 'Дополнительная информация', |
|
42 | + 'priceChanger' => 'Градация стоимости', |
|
43 | + 'field' => 'Поля', |
|
44 | + 'disabled' => 'Отключено', |
|
45 | + ]; |
|
46 | + public static $dataManagers = [ |
|
47 | + 'manager' => [ |
|
48 | + 'name' => 'Варианты доставки', |
|
49 | + 'cols' => [ |
|
50 | + 'name', |
|
51 | + 'price', |
|
52 | + 'currency_id', |
|
53 | + 'max_cart_price', |
|
54 | + 'disabled', |
|
55 | + 'field', |
|
56 | + 'priceChanger', |
|
57 | + ], |
|
58 | + 'sortMode' => true |
|
59 | + ], |
|
60 | + ]; |
|
61 | + public static $forms = [ |
|
62 | + 'manager' => [ |
|
63 | + 'map' => [ |
|
64 | + ['name', 'disabled'], |
|
65 | + ['max_cart_price', 'icon_file_id'], |
|
66 | + ['price', 'currency_id'], |
|
67 | + ['price_text'], |
|
68 | + ['info'], |
|
69 | + ['priceChanger'], |
|
70 | + ['field'] |
|
71 | + ] |
|
72 | + ]]; |
|
73 | 73 | |
74 | - public static function relations() { |
|
74 | + public static function relations() { |
|
75 | 75 | return [ |
76 | 76 | 'icon' => [ |
77 | 77 | 'model' => 'Files\File', |
@@ -92,6 +92,6 @@ discard block |
||
92 | 92 | 'col' => 'delivery_id' |
93 | 93 | ] |
94 | 94 | ]; |
95 | - } |
|
95 | + } |
|
96 | 96 | |
97 | 97 | } |