Created
February 17, 2015 17:44
-
-
Save alejandro-loza/a3b09c9170bcd89a8101 to your computer and use it in GitHub Desktop.
criteria enfermo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (order) { | |
List details = OrderDetail.createCriteria().list() { | |
eq('order', order) | |
join 'status' | |
join 'skuProfile' | |
join 'skuProfile.itemGroupProfile' | |
join 'skuProfile.itemGroupProfile.itemGroup' | |
join 'skuProfile.itemGroupProfile.itemGroup.brand' | |
join 'skuProfile.itemGroupProfile.itemGroup.itemGroupType' | |
join 'skuProfile.vertical' | |
join 'skuProfile.sku' | |
join 'skuProfile.sku.item' | |
select 'skuProfile.sku.attributes' | |
select 'skuProfile.sku.item.images' | |
} | |
def detailsWithCouponFlag = ordersCommonsService.getWithCouponFlag(details) | |
def detailsWithGuides = ordersCommonsService.findGuidesByDetails(detailsWithCouponFlag) | |
def detailsByOrderId = detailsWithGuides.groupBy { it.orderId } | |
order.metaClass.details = detailsByOrderId[order.id] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment