|
@@ -43,29 +43,39 @@ func (this *RenewUpgrade) GetBuyMsg() {
|
|
|
end := time.Unix(endtime, 0).Format("2006-01-02")
|
|
|
now := time.Unix(time.Now().Unix(), 0).Format("2006-01-02")
|
|
|
vipStatus := (*data)["i_vip_status"]
|
|
|
+ buyset := vipjy["o_buyset"]
|
|
|
// isvalidOk := true
|
|
|
|
|
|
- // str, oks := util.MQFW.FindOne("vip_upgrade", bson.M{"s_userid": userId, "i_isvalid": 0})
|
|
|
- // if oks && len(*str) > 0 && *str != nil {
|
|
|
- // area = (*str)["o_area"]
|
|
|
- // buyerclass = (*str)["a_buyerclass"]
|
|
|
- // isvalidOk = false
|
|
|
- // }
|
|
|
-
|
|
|
- dataArr := map[string]interface{}{
|
|
|
- "area": area,
|
|
|
- "buyerclass": buyerclass,
|
|
|
- "cycleunit": cycleunit,
|
|
|
- "cyclecount": cyclecount,
|
|
|
- "starttime": starttime,
|
|
|
- "endtime": endtime,
|
|
|
- "start": start,
|
|
|
- "end": end,
|
|
|
- "now": now,
|
|
|
- "vipStatus": vipStatus,
|
|
|
- // "isvalidOk": isvalidOk,
|
|
|
+ orderdata := util.Mysql.FindOne("dataexport_order", map[string]interface{}{
|
|
|
+ "user_id": userId,
|
|
|
+ "order_status": 1,
|
|
|
+ }, "filter", "create_time desc")
|
|
|
+ vmsg := entity.VipSimpleMsg{}
|
|
|
+ if len(*orderdata) > 0 && *orderdata != nil {
|
|
|
+ filterStr := qutil.ObjToString((*orderdata)["filter"])
|
|
|
+ if err := json.Unmarshal([]byte(filterStr), &vmsg); err != nil {
|
|
|
+ log.Printf("%s vipSubscribeStruct PayCallBack Unmarshal 出错 [%s]\n", filterStr)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ allArea := vmsg.Area
|
|
|
+ allIndustry := vmsg.Industry
|
|
|
+ dataArr := map[string]interface{}{
|
|
|
+ "area": area,
|
|
|
+ "buyerclass": buyerclass,
|
|
|
+ "cycleunit": cycleunit,
|
|
|
+ "cyclecount": cyclecount,
|
|
|
+ "starttime": starttime,
|
|
|
+ "endtime": endtime,
|
|
|
+ "start": start,
|
|
|
+ "end": end,
|
|
|
+ "now": now,
|
|
|
+ "vipStatus": vipStatus,
|
|
|
+ "buyset": buyset,
|
|
|
+ "allarea": allArea,
|
|
|
+ "allindustry": allIndustry,
|
|
|
+ }
|
|
|
+ this.ServeJson(dataArr)
|
|
|
}
|
|
|
- this.ServeJson(dataArr)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -179,13 +189,29 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
|
|
|
// // }
|
|
|
// endTime = util.GetDATE(date_unit, date_count, startTime.Unix())
|
|
|
// }
|
|
|
- filter := entity.VipSimpleMsg{
|
|
|
- area,
|
|
|
- industry,
|
|
|
- date_count,
|
|
|
- date_unit,
|
|
|
- orderType,
|
|
|
+ filter := entity.VipSimpleMsg{}
|
|
|
+ if pay_source == "Renew" {
|
|
|
+ filter = entity.VipSimpleMsg{
|
|
|
+ area,
|
|
|
+ industry,
|
|
|
+ nil,
|
|
|
+ nil,
|
|
|
+ date_count,
|
|
|
+ date_unit,
|
|
|
+ orderType,
|
|
|
+ }
|
|
|
+ } else if pay_source == "Upgrade" {
|
|
|
+ filter = entity.VipSimpleMsg{
|
|
|
+ allArea,
|
|
|
+ allIndustry,
|
|
|
+ area,
|
|
|
+ industry,
|
|
|
+ date_count,
|
|
|
+ date_unit,
|
|
|
+ orderType,
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
mog_id := entity.JyVipSubStruct.SaveSelectLog(userId, openId, &filter)
|
|
|
if mog_id == "" {
|
|
|
return &entity.FuncResult{false, errors.New("创建订单出错"), nil}
|