Procházet zdrojové kódy

订单明细增加规格明细

abiao před 5 roky
rodič
revize
2570dd7497

+ 5 - 12
go/gopath/src/fohow.com/apps/controllers/order_controller/order_controller.go

@@ -214,18 +214,8 @@ func (self *OrderController) Detail() {
 			self.ReturnError(403, apps.ProductNotExist, "", nil)
 		}
 		//获取商品属性详情
-		if product.SizeId > 0 {
-			productSize := product_model.GetProductAttrValueById(product.SizeId)
-			if productSize != nil {
-				product.SizeName = productSize.Name
-			}
-		}
-		if product.ColorId > 0 {
-			productColor := product_model.GetProductAttrValueById(product.ColorId)
-			if productColor != nil {
-				product.ColorName = productColor.Name
-			}
-		}
+		product.SizeName = item.SizeName
+		product.ColorName = item.ColorName
 		product.OrderCount = item.Count
 		o.Count += item.Count
 		if product.SeckilShowPrice > 0 {
@@ -293,6 +283,9 @@ func (self *OrderController) List() {
 			if product == nil {
 				continue
 			}
+			product.SizeName = orderItem.SizeName
+			product.ColorName = orderItem.ColorName
+			product.OrderCount = orderItem.Count
 			item.Count += orderItem.Count
 			product.OrderCount = orderItem.Count
 			if product.SeckilShowPrice > 0 {