Browse Source

no message

xingzai 1 year ago
parent
commit
9272487492
3 changed files with 10 additions and 2 deletions
  1. 4 2
      controllers/order.go
  2. 4 0
      models/order/order.go
  3. 2 0
      models/order/order_user_card.go

+ 4 - 2
controllers/order.go

@@ -302,12 +302,14 @@ func (this *OrderController) UserOrderList() {
 			item.OrderStatusText = "已支付"
 		}
 		if orderType == 1 {
-			item.StartDate = ""
-			item.EndDate = ""
 			if v.GoodsId == 1 {
 				item.LabelKeywordImgLink = utils.LABEL_ICO_7 //日卡图标
+				item.StartDate = v.StartDate.Format(utils.FormatDateTime)
+				item.EndDate = v.EndDate.Format(utils.FormatDateTime)
 			} else if v.GoodsId == 2 {
 				item.LabelKeywordImgLink = utils.LABEL_ICO_8 // 月卡图标
+				item.StartDate = v.StartDate.Format(utils.FormatDate)
+				item.EndDate = v.EndDate.Format(utils.FormatDate)
 			}
 		} else {
 			item.LabelKeywordImgLink = utils.LABEL_ICO_3

+ 4 - 0
models/order/order.go

@@ -65,6 +65,8 @@ type CygxOrder struct {
 	ModifyTime       time.Time `comment:"修改时间"`
 	RegisterPlatform int       `comment:"来源 1小程序,2:网页"`
 	OrderType        int       `comment:"订单类型,1:畅读卡订单,2:单场付费订单"`
+	StartDate        time.Time `comment:"开始时间"`
+	EndDate          time.Time `comment:"结束时间"`
 }
 
 type CygxOrderResp struct {
@@ -96,6 +98,8 @@ type CygxOrderResp struct {
 	CreateTime       time.Time `comment:"创建时间"`
 	ModifyTime       time.Time `comment:"修改时间"`
 	RegisterPlatform int       `comment:"来源 1小程序,2:网页"`
+	StartDate        time.Time `comment:"开始时间"`
+	EndDate          time.Time `comment:"结束时间"`
 }
 
 type CygxOrderAction struct {

+ 2 - 0
models/order/order_user_card.go

@@ -84,6 +84,8 @@ func AddCygxOrderUserCard(item *CygxOrderUserCard, itemOrder *CygxOrder) (err er
 	updateParams["OrderStatus"] = itemOrder.OrderStatus
 	updateParams["OutTradeCode"] = itemOrder.OutTradeCode
 	updateParams["ModifyTime"] = item.ModifyTime
+	updateParams["StartDate"] = item.StartDate
+	updateParams["EndDate"] = item.EndDate
 	updateParams["PaymentType"] = 1
 	ptrStructOrTableName := "cygx_order"
 	whereParam := map[string]interface{}{"order_code": itemOrder.OrderCode}