@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * @var Prefix |
| 28 | 28 | */ |
| 29 | 29 | protected $cache; |
| 30 | - protected $data_model = [ |
|
| 30 | + protected $data_model = [ |
|
| 31 | 31 | 'id' => 'int', |
| 32 | 32 | 'title' => 'ml:string' |
| 33 | 33 | ]; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | const DEFAULT_IMAGE = 'modules/Shop/assets/img/no-image.svg'; |
| 57 | 57 | |
| 58 | - protected $data_model = [ |
|
| 58 | + protected $data_model = [ |
|
| 59 | 59 | 'id' => 'int:0', |
| 60 | 60 | 'date' => 'int:0', |
| 61 | 61 | 'category' => 'int:0', |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | 'string' => '', |
| 438 | 438 | 'text' => '' |
| 439 | 439 | ]; |
| 440 | - $lang = ''; |
|
| 440 | + $lang = ''; |
|
| 441 | 441 | switch ($this->attribute_type_to_value_field($attribute_data['type'])) { |
| 442 | 442 | case 'numeric_value': |
| 443 | 443 | $value_type['numeric'] = $value; |
@@ -280,17 +280,20 @@ |
||
| 280 | 280 | $where = []; |
| 281 | 281 | $where_params = []; |
| 282 | 282 | foreach ($search_parameters as $key => $details) { |
| 283 | - if (isset($this->data_model[$key])) { // Property |
|
| 283 | + if (isset($this->data_model[$key])) { |
|
| 284 | +// Property |
|
| 284 | 285 | $where[] = "`i`.`$key` = ?"; |
| 285 | 286 | $where_params[] = $details; |
| 286 | - } elseif (is_numeric($key)) { // Tag |
|
| 287 | + } elseif (is_numeric($key)) { |
|
| 288 | +// Tag |
|
| 287 | 289 | $joins .= |
| 288 | 290 | "INNER JOIN `{$this->table}_tags` AS `t` |
| 289 | 291 | ON |
| 290 | 292 | `i`.`id` = `t`.`id` AND |
| 291 | 293 | `t`.`tag` = ?"; |
| 292 | 294 | $where_params[] = $details; |
| 293 | - } else { // Attribute |
|
| 295 | + } else { |
|
| 296 | +// Attribute |
|
| 294 | 297 | $field = @$this->attribute_type_to_value_field($Attributes->get($key)['type']); |
| 295 | 298 | if (!$field || empty($details)) { |
| 296 | 299 | continue; |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | @$_GET['asc'] |
| 55 | 55 | ) ?: [] |
| 56 | 56 | ); |
| 57 | -$orders_total = $Orders->search( |
|
| 57 | +$orders_total = $Orders->search( |
|
| 58 | 58 | [ |
| 59 | 59 | 'total_count' => 1 |
| 60 | 60 | ] + (array)$_GET, |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | const TYPE_SWITCH = 8; |
| 34 | 34 | const TYPE_COLOR_SET = 9; |
| 35 | 35 | |
| 36 | - protected $data_model = [ |
|
| 36 | + protected $data_model = [ |
|
| 37 | 37 | 'id' => 'int', |
| 38 | 38 | 'type' => 'int', |
| 39 | 39 | 'title' => 'ml:text', |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | const VISIBLE = 1; |
| 55 | 55 | const INVISIBLE = 0; |
| 56 | 56 | |
| 57 | - protected $data_model = [ |
|
| 57 | + protected $data_model = [ |
|
| 58 | 58 | 'id' => 'int:1', |
| 59 | 59 | 'parent' => 'int:0', |
| 60 | 60 | 'title' => 'ml:text', |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | const TYPE_REFUNDED = 11; |
| 36 | 36 | const TYPE_COMPLETED = 12; |
| 37 | 37 | |
| 38 | - protected $data_model = [ |
|
| 38 | + protected $data_model = [ |
|
| 39 | 39 | 'id' => 'int', |
| 40 | 40 | 'title' => 'text', |
| 41 | 41 | 'type' => 'int', |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | ':', |
| 25 | 25 | array_slice(Request::instance()->route_path, -1)[0] |
| 26 | 26 | ); |
| 27 | -$item = $Items->get_for_user(array_pop($item)); |
|
| 27 | +$item = $Items->get_for_user(array_pop($item)); |
|
| 28 | 28 | $Page->title($item['title']); |
| 29 | 29 | $Page->Description = description($item['description']); |
| 30 | 30 | $Page->canonical_url( |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | Singleton, |
| 31 | 31 | Common_actions; |
| 32 | 32 | |
| 33 | - protected $data_model = [ |
|
| 33 | + protected $data_model = [ |
|
| 34 | 34 | 'id' => 'int', |
| 35 | 35 | 'price' => 'float', |
| 36 | 36 | 'phone_needed' => 'int:0..1', |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | cs\modules\Tags\Tags as Tags_trait, |
| 14 | 14 | cs\Singleton; |
| 15 | 15 | /** |
| 16 | - * Tags trait |
|
| 17 | - * |
|
| 18 | - * Provides methods for working with tags for faster development |
|
| 19 | - * |
|
| 20 | - * @method static $this instance($check = false) |
|
| 21 | - */ |
|
| 16 | + * Tags trait |
|
| 17 | + * |
|
| 18 | + * Provides methods for working with tags for faster development |
|
| 19 | + * |
|
| 20 | + * @method static $this instance($check = false) |
|
| 21 | + */ |
|
| 22 | 22 | class Tags { |
| 23 | 23 | use |
| 24 | 24 | Tags_trait, |