|
|
@@ -56,6 +56,21 @@ func (self *OrderController) Create() {
|
|
|
}
|
|
|
orderType = order_model.ORDER_TYPE_SEKILL
|
|
|
}
|
|
|
+ sizeName := ""
|
|
|
+ colorName := ""
|
|
|
+ //获取商品属性详情
|
|
|
+ if product.SizeId > 0 {
|
|
|
+ productSize := product_model.GetProductAttrValueById(product.SizeId)
|
|
|
+ if productSize != nil {
|
|
|
+ sizeName = productSize.Name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if product.ColorId > 0 {
|
|
|
+ productColor := product_model.GetProductAttrValueById(product.ColorId)
|
|
|
+ if productColor != nil {
|
|
|
+ sizeName = productColor.Name
|
|
|
+ }
|
|
|
+ }
|
|
|
totalPrice := product.Price * count
|
|
|
//小兔微信,测试微信支付
|
|
|
if wxUId == 76 {
|
|
|
@@ -74,7 +89,7 @@ func (self *OrderController) Create() {
|
|
|
order.Save()
|
|
|
//创建订单明细
|
|
|
go new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.Price, product.RoboBalancePrice, product.Name,
|
|
|
- count)
|
|
|
+ sizeName, colorName, count)
|
|
|
|
|
|
type Order struct {
|
|
|
OrderId string `json:"order_id"`
|
|
|
@@ -138,9 +153,24 @@ func (self *OrderController) MultipleCreate() {
|
|
|
if product == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
|
+
|
|
|
+ //获取商品属性详情
|
|
|
+ sizeName := ""
|
|
|
+ colorName := ""
|
|
|
+ if product.SizeId > 0 {
|
|
|
+ productSize := product_model.GetProductAttrValueById(product.SizeId)
|
|
|
+ if productSize != nil {
|
|
|
+ sizeName = productSize.Name
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if product.ColorId > 0 {
|
|
|
+ productColor := product_model.GetProductAttrValueById(product.ColorId)
|
|
|
+ if productColor != nil {
|
|
|
+ sizeName = productColor.Name
|
|
|
+ }
|
|
|
+ }
|
|
|
totalPrice += product.Price * cNums
|
|
|
- go new(order_model.OrderDetail).Create(order.OrderId, order.Id, cartItem.ProductId, product.Price, product.RoboBalancePrice, product.Name,
|
|
|
- cNums)
|
|
|
+ go new(order_model.OrderDetail).Create(order.OrderId, order.Id, cartItem.ProductId, product.Price, product.RoboBalancePrice, product.Name, sizeName, colorName, cNums)
|
|
|
}
|
|
|
freight := order_model.FREIGHT
|
|
|
if totalPrice >= order_model.FREIGHT_LIMIT || beego.AppConfig.String("RunMode") == "dev" {
|