Sfoglia il codice sorgente

订单增加用户信息

kobe6258 5 mesi fa
parent
commit
b87f52a7e2

+ 6 - 0
domian/order/product_order.go

@@ -17,6 +17,9 @@ type ProductOrderDTO struct {
 	OrderID            string
 	UserID             int
 	TemplateUserID     int
+	RealName           string
+	AreaCode           string
+	Mobile             string
 	ProductID          int
 	ProductType        string
 	TotalAmount        string
@@ -164,6 +167,9 @@ func convertProductOrder(order ProductOrderDTO) orderDao.ProductOrder {
 		OrderID:        order.OrderID,
 		UserID:         order.UserID,
 		TemplateUserID: order.TemplateUserID,
+		RealName:       order.RealName,
+		AreaCode:       order.AreaCode,
+		Mobile:         order.Mobile,
 		ProductID:      order.ProductID,
 		ProductType:    transProductMap[order.ProductType],
 		ProductName:    order.ProductName,

+ 3 - 0
models/order/product_order.go

@@ -39,6 +39,9 @@ type ProductOrder struct {
 	OrderID          string                          `gorm:"column:order_id;size:255;comment:'订单编号'" json:"order_id"`
 	UserID           int                             `gorm:"column:user_id;default:null;comment:'用户id'" json:"user_id"`
 	TemplateUserID   int                             `gorm:"column:template_user_id;default:null;comment:'临时用户id'" json:"template_user_id"`
+	RealName         string                          `gorm:"column:real_name;default:null;comment:'姓名'" json:"real_name"`
+	AreaCode         string                          `gorm:"column:area_code;default:null;comment:'手机区号'" json:"area_code"`
+	Mobile           string                          `gorm:"column:mobile;default:null;comment:'手机号'" json:"mobile"`
 	ProductID        int                             `gorm:"column:product_id;default:null;comment:'产品id'" json:"product_id"`
 	ProductType      merchantDao.MerchantProductType `gorm:"column:product_type;default:null;comment:'产品类型'" json:"product_type"`
 	ProductName      string                          `gorm:"column:product_name;default:null;comment:'商品名称'" json:"product_name"`

+ 3 - 0
service/order/order_service.go

@@ -67,6 +67,9 @@ func CreateProductOrder(templateUser user.User, productId int, orderNo string) (
 		OrderID:        orderNo,
 		UserID:         officialUser.ID,
 		TemplateUserID: templateUser.Id,
+		RealName:       templateUser.Username,
+		AreaCode:       templateUser.AreaCode,
+		Mobile:         templateUser.Mobile,
 		ProductID:      productId,
 		ProductType:    productInfo.Type,
 		ProductName:    productInfo.ProductTile,