Skip to content

Commit

Permalink
Select the right column when the attribute type is a integer
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin committed Mar 15, 2022
1 parent c888a2e commit e5262bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Scopes/Product/WithProductAttributesScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function apply(Builder $builder, Model $model)
$attribute = (object) $attribute;

if ($attribute->flat) {
if ($attribute->input == 'select' && !in_array($attribute->code, ['tax_class_id'])) {
if ($attribute->input == 'select' && $attribute->type != 'int') {
$builder->addSelect($builder->getQuery()->from.'.'.$attribute->code.'_value AS '.$attribute->code);
} else {
$builder->addSelect($builder->getQuery()->from.'.'.$attribute->code.' AS '.$attribute->code);
Expand Down

0 comments on commit e5262bf

Please sign in to comment.