Skip to content

Commit

Permalink
Removed ->> syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin committed Sep 19, 2024
1 parent bc8c48b commit b56abf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Models/Scopes/Attribute/OnlyProductAttributesScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public function apply(Builder $builder, Model $model)
FROM catalog_product_super_attribute
WHERE catalog_product_super_attribute.attribute_id = eav_attribute.attribute_id
) AS `super`'),
DB::raw("additional_data->>'$.swatch_input_type' = 'text' AS `text_swatch`"),
DB::raw("additional_data->>'$.swatch_input_type' = 'visual' AS `visual_swatch`"),
DB::raw("additional_data->>'$.update_product_preview_image' = 1 AS `update_image`"),
DB::raw("JSON_UNQUOTE(JSON_EXTRACT(additional_data, '$.swatch_input_type')) = 'text' AS `text_swatch`"),
DB::raw("JSON_UNQUOTE(JSON_EXTRACT(additional_data, '$.swatch_input_type')) = 'visual' AS `visual_swatch`"),
DB::raw("JSON_UNQUOTE(JSON_EXTRACT(additional_data, '$.update_product_preview_image')) = 1 AS `update_image`"),
'position'
)
->join('catalog_eav_attribute', 'eav_attribute.attribute_id', '=', 'catalog_eav_attribute.attribute_id')
Expand Down
6 changes: 3 additions & 3 deletions src/Models/Scopes/Product/WithProductSuperAttributesScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public function apply(Builder $builder, Model $model)
->selectRaw('JSON_OBJECTAGG(eav_attribute.attribute_id, JSON_OBJECT(
"code", `attribute_code`,
"label", COALESCE(NULLIF(`value`, ""), `frontend_label`),
"text_swatch", additional_data->>"$.swatch_input_type" = "text",
"visual_swatch", additional_data->>"$.swatch_input_type" = "visual",
"update_image", additional_data->>"$.update_product_preview_image" = 1
"text_swatch", JSON_UNQUOTE(JSON_EXTRACT(additional_data, "$.swatch_input_type")) = "text",
"visual_swatch", JSON_UNQUOTE(JSON_EXTRACT(additional_data, "$.swatch_input_type")) = "visual",
"update_image", JSON_UNQUOTE(JSON_EXTRACT(additional_data, "$.update_product_preview_image")) = 1
)) AS `super_attributes`')
->join('eav_attribute', 'eav_attribute.attribute_id', '=', 'catalog_product_super_attribute.attribute_id')
->join('catalog_eav_attribute', 'catalog_eav_attribute.attribute_id', '=', 'catalog_product_super_attribute.attribute_id')
Expand Down

0 comments on commit b56abf6

Please sign in to comment.