浏览代码

订单有效期开始日期

xuzhiheng 5 年之前
父节点
当前提交
d9395d2704

+ 2 - 1
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -177,12 +177,13 @@ func (this *vipSubscribeStruct) UpgradeSubVip(userId string, vmsg VipSimpleMsg,
 			log.Printf("%s更新结束%d日期出错\n", userId, endTime.Unix())
 			return false
 		}
+		effectTime := time.Date(time.Now().Year(), time.Now().Month()+1, 1, 0, 0, 0, 0, time.Local)
 		return util.MQFW.Save("vip_upgrade",
 			bson.M{
 				"s_userid":     userId,            //试用设置地区
 				"a_buyerclass": vmsg.Industry,     //试用设置行业
 				"o_area":       vmsg.Area,         //购买内容 城市、省份、行业数量
-				"l_validtime":  startTime.Unix(),  //生效时间
+				"l_validtime":  effectTime.Unix(), //生效时间
 				"l_createtime": time.Now().Unix(), //入库时间
 				"o_buyset":     buyset,            //购买内容数量
 				"i_isvalid":    0,                 //是否已经生效 0-未生效

+ 4 - 2
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -117,10 +117,12 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		if pay_source == "Upgrade" { //计算升级时间
 			if effect == "now" { //立即生效
 				orderType = 3
-				startTime = time.Now()
+				//				startTime = time.Now()
+				startTime = time.Unix(start, 0)
 			} else { //下月生效
 				orderType = 4
-				startTime = time.Date(time.Now().Year(), time.Now().Month()+1, 1, 0, 0, 0, 0, time.Local)
+				//				startTime = time.Date(time.Now().Year(), time.Now().Month()+1, 1, 0, 0, 0, 0, time.Local)
+				startTime = time.Unix(start, 0)
 			}
 
 		} else { //续费时间

+ 15 - 14
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -243,20 +243,21 @@
 						setTimeout(function(){
 							window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
 						},500)
-					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-//	                	alert("开发环境【支付跳转完成】")
-		                try{
-//		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-//		                    window.location.reload();
-		                }catch(e){
-		                  alert(e)
-		                }
-	  				}else{
-	                	weui.toast("系统异常,请稍微再试",{
-	                  		duration: 2000,
-	                  		className: 'custom-toast',
-	                	});
-	  				}
+					}	
+//					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
+////	                	alert("开发环境【支付跳转完成】")
+//		                try{
+////		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
+////		                    window.location.reload();
+//		                }catch(e){
+//		                  alert(e)
+//		                }
+//	  				}else{
+//	                	weui.toast("系统异常,请稍微再试",{
+//	                  		duration: 2000,
+//	                  		className: 'custom-toast',
+//	                	});
+//	  				}
   				});
   			}   
 		}catch(e){

+ 15 - 14
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -341,20 +341,21 @@
 						setTimeout(function(){
 							window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
 						},500)
-					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
-//	                	alert("开发环境【支付跳转完成】")
-		                try{
-//		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
-//		                	window.location.reload();
-		                }catch(e){
-		                  alert(e)
-		                }
-	  				}else{
-	                	weui.toast("系统异常,请稍微再试",{
-	                  		duration: 2000,
-	                  		className: 'custom-toast',
-	                	});
-	  				}
+					}
+//					}else if(r.err_msg == "get_brand_wcpay_request:cancel"){               
+////	                	alert("开发环境【支付跳转完成】")
+//		                try{
+////		  					window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode="+ordercode);
+////		                	window.location.reload();
+//		                }catch(e){
+//		                  alert(e)
+//		                }
+//	  				}else{
+//	                	weui.toast("系统异常,请稍微再试",{
+//	                  		duration: 2000,
+//	                  		className: 'custom-toast',
+//	                	});
+//	  				}
   				});
   			}   
 		}catch(e){