1 | <?php |
||
34 | class Delivery extends \Model { |
||
35 | |||
36 | public static $objectName = 'Доставка'; |
||
37 | public static $cols = [ |
||
38 | //Основные параметры |
||
39 | 'name' => ['type' => 'text'], |
||
40 | 'delivery_provider_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'provider'], |
||
41 | 'price' => ['type' => 'decimal'], |
||
42 | 'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'], |
||
43 | 'price_text' => ['type' => 'textarea'], |
||
44 | 'max_cart_price' => ['type' => 'decimal'], |
||
45 | 'icon_file_id' => ['type' => 'image'], |
||
46 | 'info' => ['type' => 'html'], |
||
47 | 'disabled' => ['type' => 'bool'], |
||
48 | //Системные |
||
49 | 'weight' => ['type' => 'number'], |
||
50 | 'date_create' => ['type' => 'dateTime'], |
||
51 | //Менеджеры |
||
52 | 'field' => ['type' => 'dataManager', 'relation' => 'fields'], |
||
53 | 'priceChanger' => ['type' => 'dataManager', 'relation' => 'prices'] |
||
54 | ]; |
||
55 | public static $labels = [ |
||
56 | 'name' => 'Название', |
||
57 | 'price_type' => 'Тип расчета стоимости', |
||
58 | 'price' => 'Стоимость', |
||
59 | 'price_text' => 'Текстовое описание стоимости (отображается вместо цены)', |
||
60 | 'max_cart_price' => 'Басплатно при', |
||
61 | 'icon_file_id' => 'Иконка', |
||
62 | 'currency_id' => 'Валюта', |
||
63 | 'info' => 'Дополнительная информация', |
||
64 | 'priceChanger' => 'Градация стоимости', |
||
65 | 'field' => 'Поля', |
||
66 | 'disabled' => 'Отключено', |
||
67 | ]; |
||
68 | public static $dataManagers = [ |
||
69 | 'manager' => [ |
||
70 | 'name' => 'Варианты доставки', |
||
71 | 'cols' => [ |
||
72 | 'name', |
||
73 | 'delivery_provider_id', |
||
74 | 'price', |
||
75 | 'currency_id', |
||
76 | 'max_cart_price', |
||
77 | 'disabled', |
||
78 | 'field', |
||
79 | 'priceChanger', |
||
80 | ], |
||
81 | 'sortMode' => true |
||
82 | ], |
||
83 | ]; |
||
84 | public static $forms = [ |
||
85 | 'manager' => [ |
||
86 | 'map' => [ |
||
87 | ['name','delivery_provider_id', 'disabled'], |
||
88 | ['price', 'currency_id'], |
||
89 | ['max_cart_price', 'icon_file_id'], |
||
90 | ['price_text'], |
||
91 | ['info'], |
||
92 | ['priceChanger'], |
||
93 | ['field'] |
||
94 | ] |
||
95 | ]]; |
||
96 | |||
97 | public static function relations() { |
||
123 | |||
124 | } |
||
125 |