|
@@ -114,6 +114,11 @@ func (this *OrderController) OrderList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ var mobiles []string
|
|
|
+ for _, v := range list {
|
|
|
+ mobiles = append(mobiles, v.Mobile)
|
|
|
+ }
|
|
|
+ inviteNameMap := cygxService.GetCygxUserBusinessCardMap(mobiles) // 根据手机号获取邀请人
|
|
|
|
|
|
for _, v := range list {
|
|
|
item := new(cygx.OrderListResp)
|
|
@@ -153,15 +158,20 @@ func (this *OrderController) OrderList() {
|
|
|
item.CompanyId = v.CompanyId
|
|
|
item.CompanyName = v.CompanyName
|
|
|
item.SellerName = v.SellerName
|
|
|
- item.InviteName = "推荐人"
|
|
|
+ item.InviteName = inviteNameMap[v.Mobile]
|
|
|
item.PaymentProject = v.GoodsName
|
|
|
|
|
|
- if v.OrderStatus == 2 {
|
|
|
- item.PayTime = v.PayTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
+ //if v.OrderStatus == 2 {
|
|
|
+ item.PayTime = v.PayTime.Format(utils.FormatDateTime)
|
|
|
+ //}
|
|
|
if orderType == 1 {
|
|
|
- item.StartDate = time.Now().Format(utils.FormatDateTime)
|
|
|
- item.EndDate = time.Now().AddDate(0, 0, 3).Format(utils.FormatDateTime)
|
|
|
+ if v.GoodsId == 1 {
|
|
|
+ item.StartDate = v.StartDate.Format(utils.FormatDateTime)
|
|
|
+ item.EndDate = v.EndDate.Format(utils.FormatDateTime)
|
|
|
+ } else {
|
|
|
+ item.StartDate = v.StartDate.Format(utils.FormatDate)
|
|
|
+ item.EndDate = v.EndDate.Format(utils.FormatDate)
|
|
|
+ }
|
|
|
}
|
|
|
item.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
|
|
|
resp.List = append(resp.List, item)
|
|
@@ -344,7 +354,11 @@ func (this *OrderController) OrderRefundList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ var mobiles []string
|
|
|
+ for _, v := range list {
|
|
|
+ mobiles = append(mobiles, v.Mobile)
|
|
|
+ }
|
|
|
+ inviteNameMap := cygxService.GetCygxUserBusinessCardMap(mobiles) // 根据手机号获取邀请人
|
|
|
for _, v := range list {
|
|
|
item := new(cygx.OrderListResp)
|
|
|
item.OrderCode = v.OrderCode
|
|
@@ -377,17 +391,22 @@ func (this *OrderController) OrderRefundList() {
|
|
|
item.CompanyId = v.CompanyId
|
|
|
item.CompanyName = v.CompanyName
|
|
|
item.SellerName = v.SellerName
|
|
|
- item.InviteName = "推荐人"
|
|
|
+ item.InviteName = inviteNameMap[v.Mobile]
|
|
|
item.PaymentProject = v.GoodsName
|
|
|
item.RefundTime = v.RefundTime.Format(utils.FormatDateTime)
|
|
|
item.RefundRemark = v.RefundRemark
|
|
|
|
|
|
- if v.OrderStatus == 2 {
|
|
|
- item.PayTime = v.PayTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
+ //if v.OrderStatus == 2 {
|
|
|
+ item.PayTime = v.PayTime.Format(utils.FormatDateTime)
|
|
|
+ //}
|
|
|
if orderType == 1 {
|
|
|
- item.StartDate = time.Now().Format(utils.FormatDateTime)
|
|
|
- item.EndDate = time.Now().AddDate(0, 0, 3).Format(utils.FormatDateTime)
|
|
|
+ if v.GoodsId == 1 {
|
|
|
+ item.StartDate = v.StartDate.Format(utils.FormatDateTime)
|
|
|
+ item.EndDate = v.EndDate.Format(utils.FormatDateTime)
|
|
|
+ } else {
|
|
|
+ item.StartDate = v.StartDate.Format(utils.FormatDate)
|
|
|
+ item.EndDate = v.EndDate.Format(utils.FormatDate)
|
|
|
+ }
|
|
|
}
|
|
|
item.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
|
|
|
resp.List = append(resp.List, item)
|