Browse Source

最后一次购买的订单

zhangxinlei1996 3 years ago
parent
commit
8a35d85fc0
1 changed files with 13 additions and 1 deletions
  1. 13 1
      src/jfw/modules/subscribepay/src/service/orderListDetails.go

+ 13 - 1
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -90,7 +90,19 @@ func (this *OrderListDetails) GetOrderPayAllMsg() {
 				(*oData)["return_type"] = (*returnRecord)["return_type"]
 				(*oData)["return_type"] = (*returnRecord)["return_type"]
 			}
 			}
 		}
 		}
-
+		//获取最后一次购买的订单
+		lastOrderMap := LastOrder(qutil.ObjToString((*oData)["product_type"]), userId)
+		//最后一次够买的vip订单
+		for _, n := range lastOrderMap {
+			if n == orderCode {
+				(*oData)["lastbuy_code"] = n
+				if data, ok := util.MQFW.FindById("user", userId, `{"i_vip_status":1,"o_jy":1}`); data != nil && ok && len(*data) > 0 {
+					(*oData)["i_vip_status"] = qutil.Int64All((*data)["i_vip_status"])
+					ojy := qutil.ObjToMap((*data)["o_jy"])
+					(*oData)["i_pp_status"] = qutil.IntAllDef((*ojy)["i_ppstatus"], 0) //i_pp_status : -1 到期  0未购买 1已购买
+				}
+			}
+		}
 		//卡卷id加密
 		//卡卷id加密
 		if (*oData)["d_relation_id"] != "" {
 		if (*oData)["d_relation_id"] != "" {
 			(*oData)["userLotteryId"] = qutil.SE.Encode2Hex(qutil.ObjToString((*oData)["d_relation_id"]))
 			(*oData)["userLotteryId"] = qutil.SE.Encode2Hex(qutil.ObjToString((*oData)["d_relation_id"]))