소스 검색

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

wangkaiyue 5 년 전
부모
커밋
e49675c075

+ 26 - 3
src/config.json

@@ -32,7 +32,7 @@
         }
     },
     "agreement": "http",
-    "webdomain": "http://web-jydev-xzh.jianyu360.cn",
+    "webdomain": "http://web-jydev-ws.jianyu360.cn",
     "redirect": {
         "searchinfo": "/jylab/mainSearch",
         "rssset": "/swordfish/historypush",
@@ -210,8 +210,31 @@
     "advertName": "广告",
     "advertUrl": "/swordfish/about",
     "wxJianyu": {
-        "appid": "wxd66e9589c9fecff6",
-        "appsecret": "4d9d4b9ddab59e65fcb7bed125fbd342"
+        "appid": "wx5b1c6e7cc4dac0e4",
+        "appsecret": "b026103ffebd2291b3edb7a269612112",
+        "pay": {
+            "mchid": "1418321102",
+            "key": "topnet2016topnet2016topnet2016ab",
+            "attachmsg": "剑鱼标讯打赏",
+            "bodymsg": "剑鱼标讯-招标信息打赏",
+            "detailmsg": "招标推送信息[%s] 打赏%s元钱",
+            "sjdc_attachmsg": "剑鱼标讯-历史数据",
+            "sjdc_bodymsg": "剑鱼标讯-历史数据",
+            "sjdc_detailmsg": "剑鱼标讯-历史数据",
+            "sjbd_msg": "剑鱼标讯-数据报告",
+            "subvip_msg":"剑鱼标讯-vip订阅"
+        },
+        "openidSwitch": {
+            "oIMvJvrVXG89597EFmYiSiznbyyY": "oHwE_wEQlEBvjZJOyZeNnQcgKQMo",
+            "ouCYjw4BJMbpdMRYrTTLb9nFi2RE": "oHwE_wNA1V0DURDO0h7wAriz0qIY"
+        }
+    },
+    "aliPay": {
+        "appid": "2016092900620854",
+        "reqUrl": "https://openapi.alipaydev.com/gateway.do",
+        "Subject": "剑鱼数据导出",
+        "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAtO7CU4hpdcMmV43MEA8bqQJYYx+f6yvYkP0nFc/oCvU24bU6zAdK/H2H56quEwD8Dh5YtVTfUCcKqpcG9HXY11TXWKCEUQiK1tkb0o7oSSURwk6h1DdDbg8m1+H8s+k+mvMvcqVCYKYi03PIPQyJCuHmzx/vcaALXRr2HOrEFaFFA8WYST1rywiKeyrC9PCNX1aJjGADhCs3cGrdZEJc4k+2tIHTYJccx+mJ96QiEkzFhJTqEmSFPcNqNUX9uCPgeVhfHW2pRNyffvrhoEyeSr1QoOpaYyn0I5JD2axnypBFCbk6P69LY3eGNKtOe81lp9hiZbMYpXPqb6KwPXTVQQIDAQABAoIBAEbJQm276MaR2uZWK4f84S12JW5iaQZw2QGgiTIXbQkcdqRHawF3uPafhhQ0ynXU5MgBR2NqGRQasimbfLUXhgZ4wueBpUKuvOLhfekaz/YN8qy6ZsXH+TGN6/x6BYu9rSiiC+YmkZmOZgGkQqrfxJ3lU4+lRuCFZOzAJ5mYn652CHRJXy6eDgZfyFLP2ol4/ioJEhwnGFXV345DlsVgmXTEe+IfjTyuvzxBtjod4lfu3dj/f2PhPrcgvN0ZQf1ldZbS+6FkMWInMOQt/WsJ/ANfiKgQ4sPzlxIhmVjrvDlnYTc1lbFekyInzZumV0pDyId+1Y6LAjxJTAhnjFAlBSECgYEAwsQdxOiZNLtxZ8J8JCQHKERYIo7euArW0iAurF+3Q9VNeGj0voFrmfHPju5OF5BHtuc7D3lkwZG4Ac+pyQtxF5dsEMl4vBoNc6onRQFsSDVEEIpl7OBghGlg1as23tvPSMh7DKnILM9OzVfFQ9WLvwHJwLRGsM7LOtmNovq4UFsCgYEA7dE/9Avr5YtCUjij8Y2zkAxN6qb8+ggqFoPiCr91JNGaKNKV9D2K7D3Zk49TXFJm7SX2zgYFuqR2Pa9vAWh9jtmwsc8L0qpIym4J1MM5ud/Xiu9c8O/prQOr7JlICNdk8WfqGbUC83BYfWa5SDonlXFYi6x3LlXdZnvEfZF645MCgYAC2ZnR6tFrGx8StJ7abIiKR02+27ZYnRf9pSjprtDgtjtW+royG3S2oPo3jjcoUx0piQKtPEqEJpy5sg86+ObjwHx9VmVk40C1I5VFhjrOZ7EiSNQq/jGLXntjRQkdg7vpxb0/NzDNrw7pJFKnpnVQCzenkTvDlJMWvl47N04BJwKBgHnpVtuIcPlPFkSH/KMLfQ1PAXJVAEI8hTbdjLbtxuOE/34F1hFKqzjHzA2034roQxM27vpWZAF15Zdho4oZQqREPCwqc2kfGgmLt0Z2fdUnRptWcVKh6ixjQXMccKz3niuSlZNwE38wDGzciAbaqQgW/sk7NC1wnvq2X9fvCAw5AoGANG2usqWYF4x+LvbhcdrKpJsjtvkLa2u9g2/wNXdoj+tBrv310O22/YM5LOcq9MrKPlx1S1C1KLoQO9TWFZiYuQ9C/sk7/ZTNmKQxCxVV0FVPaBYp+meD6sjgoRVJvaqY0UxnJwlHWMrusPTFua7Mtogqx9cvzlQolWh5VX7N1DM=\n-----END RSA PRIVATE KEY-----",
+        "callbackPublicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqkZY9RWrX1cZi/AWuBn7u6bjoT2RMBaq4Gdc87CgrIZm89wa28mYzbnuOrzxGtEMP82lU/KoVAbzY46j7s+bR0qUyUwQyFDFHYzDNSjhngeokzcZ+8rU6a8IOyXOHU0V2BLuvzKb44P4ctzZpmgtDZfxMbAt0ULumz9ma3elYa3pEYgQCoWm5i9eiN8DwhY2uBKZ94vW8+c2iCSwoNntZt6S608TYNOICl7nNWIR+zu3f3HnEE+7mQR37XC1aJWmtH5hKrHF8W5PVzEGhOWETcEdpUmaLhXOfN9nCBKNgFbYUmH+r6s93kfdHAqm6MEuFE6m42nmk6lqoDhEeHKteQIDAQAB"
     },
     "industry": "分类综合测试",
     "recommendEntLimit": "50",

+ 1 - 1
src/jfw/modules/subscribepay/src/config.json

@@ -30,7 +30,7 @@
         "passWord": "Topnet123"
     },
 	"appPushServiceRpc": "127.0.0.1:5566",
-    "webdomain": "http://web-jydev-xzh.jianyu360.cn",
+    "webdomain": "http://web-jydev-ws.jianyu360.cn",
     "mail": [
         {
             "addr": "smtp.exmail.qq.com",

+ 316 - 33
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -23,17 +23,9 @@ type VipSimpleMsg struct {
 	Industry   []string                `json:"industry"`
 	Cyclecount int                     `json:"cyclecount"`
 	Cycleunit  int                     `json:"cycleunit"`
-	PaySource  string                  `json:"paysource"`
-}
-
-type VipUpgradeMsg struct {
-	Id            string                  `json:"_id"`
-	Area          *map[string]interface{} `json:"area"`
-	Industry      []string                `json:"industry"`
-	PaySource     string                  `json:"paysource"`
-	ProCyclecount int                     `json:"procyclecount"`
-	ProCycleunit  int                     `json:"procycleunit"`
-	Effect        string                  `json:"effect"`
+	Paysource  string                  `json:"paysource"`
+	Endtime    string                  `json:"endtime"`
+	Effect     string                  `json:"effect"`
 }
 
 //支付完成回调
@@ -54,33 +46,324 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) (ok bool) {
 			if err := json.Unmarshal([]byte(filterStr), &vmsg); err != nil {
 				log.Printf("%s vipSubscribeStruct PayCallBack Unmarshal 出错 [%s]\n", userid, filterStr)
 			}
-			startTime := time.Now()
-			var endTime time.Time
-			if vmsg.Cycleunit == 1 { //年
-				endTime = startTime.AddDate(vmsg.Cyclecount, 0, 0)
-			} else if vmsg.Cycleunit == 2 { //月
-				endTime = startTime.AddDate(0, vmsg.Cyclecount, 0)
+			if vmsg.Paysource == "open" {
+				startTime := time.Now()
+				var endTime time.Time
+				if vmsg.Cycleunit == 1 { //年
+					endTime = startTime.AddDate(vmsg.Cyclecount, 0, 0)
+				} else if vmsg.Cycleunit == 2 { //月
+					endTime = startTime.AddDate(0, vmsg.Cyclecount, 0)
+				}
+				update := util.Mysql.Update("dataexport_order", map[string]interface{}{
+					"order_status": 0,
+					"out_trade_no": param.OutTradeno,
+					"order_money":  param.TotalFee,
+					//"user_openid":  openid,
+				}, map[string]interface{}{
+					"pay_money":    param.CashFee,
+					"pay_time":     pay_time,
+					"order_status": 1,
+					"vip_endtime":  qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+				})
+				if update {
+					if JyVipSubStruct.StartSubVip(userid, vmsg.Area, vmsg.Industry, startTime, endTime, false, vmsg.Cyclecount, vmsg.Cycleunit) {
+						ok = true
+					}
+				}
+			} else if vmsg.Paysource == "Renew" {
+				endtime := qutil.Int64All(vmsg.Endtime)
+				nowTime := time.Now().Unix()
+				if nowTime > endtime {
+					endtime = nowTime
+				}
+				endtimes := time.Unix(endtime, 0)
+				var endTime time.Time
+				if vmsg.Cycleunit == 1 { //年
+					endTime = endtimes.AddDate(vmsg.Cyclecount, 0, 0)
+				} else if vmsg.Cycleunit == 2 { //月
+					endTime = endtimes.AddDate(0, vmsg.Cyclecount, 0)
+				}
+				update := false
+				if nowTime > endtime {
+					startTime := time.Now()
+					update = util.Mysql.Update("dataexport_order", map[string]interface{}{
+						"order_status": 0,
+						"out_trade_no": param.OutTradeno,
+						"order_money":  param.TotalFee,
+						//"user_openid":  openid,
+					}, map[string]interface{}{
+						"pay_money":     param.CashFee,
+						"pay_time":      pay_time,
+						"order_status":  1,
+						"vip_starttime": qutil.FormatDate(&startTime, qutil.Date_Full_Layout),
+						"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+					})
+				} else {
+					data, oks := util.MQFW.FindById("user", userid, nil)
+					var starttime time.Time
+					if oks && len(*data) > 0 && *data != nil {
+						start := qutil.Int64All((*data)["l_vip_starttime"])
+						starttime = time.Unix(start, 0)
+					}
+					update = util.Mysql.Update("dataexport_order", map[string]interface{}{
+						"order_status": 0,
+						"out_trade_no": param.OutTradeno,
+						"order_money":  param.TotalFee,
+						//"user_openid":  openid,
+					}, map[string]interface{}{
+						"pay_money":     param.CashFee,
+						"pay_time":      pay_time,
+						"order_status":  1,
+						"vip_starttime": qutil.FormatDate(&starttime, qutil.Date_Full_Layout),
+						"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+					})
+				}
+				if update {
+					area := *vmsg.Area
+					industry := vmsg.Industry
+					buyset := SubvipBuySet{}
+					if len(area) > 0 {
+						pCount := 0
+						citys := map[string]interface{}{}
+						for k, v := range area {
+							tmp := v.([]interface{})
+							if len(tmp) == 0 { //省份
+								pCount++
+							} else { //城市
+								citys[k] = len(tmp)
+							}
+						}
+						buyset.Citys = citys      //城市
+						buyset.AreaCount = pCount //地区
+					} else {
+						buyset.BuyerclassCount = -1 //全国
+					}
+					//行业数量
+					buyset.BuyerclassCount = qutil.If(len(industry) > 0, len(industry), -1).(int)
+					if nowTime > endtime {
+						if util.MQFW.UpdateById("user", userid,
+							bson.M{"$set": bson.M{
+								"o_vipjy.o_area":       area,            //试用设置地区
+								"o_vipjy.a_buyerclass": industry,        //试用设置行业
+								"o_vipjy.o_buyset":     buyset,          //购买内容 城市、省份、行业数量
+								"o_vipjy.i_cycleunit":  vmsg.Cycleunit,  //购买单位
+								"o_vipjy.i_cyclecount": vmsg.Cyclecount, //购买时长
+								"l_vip_starttime":      nowTime,         //开始时间
+								"l_vip_endtime":        endTime.Unix(),  //结束时间
+							}}) {
+							ok = true
+						}
+					} else {
+						if util.MQFW.UpdateById("user", userid,
+							bson.M{"$set": bson.M{
+								"o_vipjy.o_area":       area,            //试用设置地区
+								"o_vipjy.a_buyerclass": industry,        //试用设置行业
+								"o_vipjy.o_buyset":     buyset,          //购买内容 城市、省份、行业数量
+								"o_vipjy.i_cycleunit":  vmsg.Cycleunit,  //购买单位
+								"o_vipjy.i_cyclecount": vmsg.Cyclecount, //购买时长
+								//								"l_vip_starttime":      startTime.Unix(),        //开始时间
+								"l_vip_endtime": endTime.Unix(), //结束时间
+							}}) {
+							ok = true
+						}
+					}
+				}
+			} else {
+				effect := vmsg.Effect
+				endtime := qutil.Int64All(vmsg.Endtime)
+				endtimes := time.Unix(endtime, 0)
+				var endTime time.Time
+				if effect == "now" {
+					if vmsg.Cycleunit >= 1 {
+						if vmsg.Cycleunit == 1 { //年
+							endTime = endtimes.AddDate(vmsg.Cyclecount, 0, 0)
+						} else if vmsg.Cycleunit == 2 { //月
+							endTime = endtimes.AddDate(0, vmsg.Cyclecount, 0)
+						}
+						data, oks := util.MQFW.FindById("user", userid, nil)
+						var starttime time.Time
+						if oks && len(*data) > 0 && *data != nil {
+							start := qutil.Int64All((*data)["l_vip_starttime"])
+							starttime = time.Unix(start, 0)
+						}
+						update := util.Mysql.Update("dataexport_order", map[string]interface{}{
+							"order_status": 0,
+							"out_trade_no": param.OutTradeno,
+							"order_money":  param.TotalFee,
+							//"user_openid":  openid,
+						}, map[string]interface{}{
+							"pay_money":     param.CashFee,
+							"pay_time":      pay_time,
+							"order_status":  1,
+							"vip_starttime": qutil.FormatDate(&starttime, qutil.Date_Full_Layout),
+							"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+						})
+						if update {
+							area := *vmsg.Area
+							industry := vmsg.Industry
+							buyset := SubvipBuySet{}
+							if len(area) > 0 {
+								pCount := 0
+								citys := map[string]interface{}{}
+								for k, v := range area {
+									tmp := v.([]interface{})
+									if len(tmp) == 0 { //省份
+										pCount++
+									} else { //城市
+										citys[k] = len(tmp)
+									}
+								}
+								buyset.Citys = citys      //城市
+								buyset.AreaCount = pCount //地区
+							} else {
+								buyset.BuyerclassCount = -1 //全国
+							}
+							//行业数量
+							buyset.BuyerclassCount = qutil.If(len(industry) > 0, len(industry), -1).(int)
+							if util.MQFW.UpdateById("user", userid,
+								bson.M{"$set": bson.M{
+									"o_vipjy.o_area":       area,            //试用设置地区
+									"o_vipjy.a_buyerclass": industry,        //试用设置行业
+									"o_vipjy.o_buyset":     buyset,          //购买内容 城市、省份、行业数量
+									"o_vipjy.i_cycleunit":  vmsg.Cycleunit,  //购买单位
+									"o_vipjy.i_cyclecount": vmsg.Cyclecount, //购买时长
+									//								"l_vip_starttime":      startTime.Unix(),        //开始时间
+									"l_vip_endtime": endTime.Unix(), //结束时间
+								}}) {
+								ok = true
+							}
+						}
+					} else {
+						data, oks := util.MQFW.FindById("user", userid, nil)
+						var starttime time.Time
+						if oks && len(*data) > 0 && *data != nil {
+							start := qutil.Int64All((*data)["l_vip_starttime"])
+							starttime = time.Unix(start, 0)
+						}
+						update := util.Mysql.Update("dataexport_order", map[string]interface{}{
+							"order_status": 0,
+							"out_trade_no": param.OutTradeno,
+							"order_money":  param.TotalFee,
+							//"user_openid":  openid,
+						}, map[string]interface{}{
+							"pay_money":     param.CashFee,
+							"pay_time":      pay_time,
+							"order_status":  1,
+							"vip_starttime": qutil.FormatDate(&starttime, qutil.Date_Full_Layout),
+							"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+						})
+						if update {
+							area := *vmsg.Area
+							industry := vmsg.Industry
+							buyset := SubvipBuySet{}
+							if len(area) > 0 {
+								pCount := 0
+								citys := map[string]interface{}{}
+								for k, v := range area {
+									tmp := v.([]interface{})
+									if len(tmp) == 0 { //省份
+										pCount++
+									} else { //城市
+										citys[k] = len(tmp)
+									}
+								}
+								buyset.Citys = citys      //城市
+								buyset.AreaCount = pCount //地区
+							} else {
+								buyset.BuyerclassCount = -1 //全国
+							}
+							//行业数量
+							buyset.BuyerclassCount = qutil.If(len(industry) > 0, len(industry), -1).(int)
+							if util.MQFW.UpdateById("user", userid,
+								bson.M{"$set": bson.M{
+									"o_vipjy.o_area":       area,     //试用设置地区
+									"o_vipjy.a_buyerclass": industry, //试用设置行业
+									"o_vipjy.o_buyset":     buyset,   //购买内容 城市、省份、行业数量
+								}}) {
+								ok = true
+							}
+						}
+					}
+				} else {
+					if vmsg.Cycleunit >= 1 {
+						if vmsg.Cycleunit == 1 { //年
+							endTime = endtimes.AddDate(vmsg.Cyclecount, 0, 0)
+						} else if vmsg.Cycleunit == 2 { //月
+							endTime = endtimes.AddDate(0, vmsg.Cyclecount, 0)
+						}
+						data, oks := util.MQFW.FindById("user", userid, nil)
+						var starttime time.Time
+						if oks && len(*data) > 0 && *data != nil {
+							start := qutil.Int64All((*data)["l_vip_starttime"])
+							starttime = time.Unix(start, 0)
+						}
+						update := util.Mysql.Update("dataexport_order", map[string]interface{}{
+							"order_status": 0,
+							"out_trade_no": param.OutTradeno,
+							"order_money":  param.TotalFee,
+							//"user_openid":  openid,
+						}, map[string]interface{}{
+							"pay_money":     param.CashFee,
+							"pay_time":      pay_time,
+							"order_status":  1,
+							"vip_starttime": qutil.FormatDate(&starttime, qutil.Date_Full_Layout),
+							"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+						})
+						if update {
+							if util.MQFW.UpdateById("user", userid,
+								bson.M{"$set": bson.M{
+									"o_vipjy.i_cycleunit":  vmsg.Cycleunit,  //购买单位
+									"o_vipjy.i_cyclecount": vmsg.Cyclecount, //购买时长
+									//								"l_vip_starttime":      startTime.Unix(),        //开始时间
+									"l_vip_endtime": endTime.Unix(), //结束时间
+								}}) {
+								ok = true
+							}
+						}
+					} else {
+						data, oks := util.MQFW.FindById("user", userid, nil)
+						var starttime time.Time
+						if oks && len(*data) > 0 && *data != nil {
+							start := qutil.Int64All((*data)["l_vip_starttime"])
+							starttime = time.Unix(start, 0)
+						}
+						update := util.Mysql.Update("dataexport_order", map[string]interface{}{
+							"order_status": 0,
+							"out_trade_no": param.OutTradeno,
+							"order_money":  param.TotalFee,
+							//"user_openid":  openid,
+						}, map[string]interface{}{
+							"pay_money":     param.CashFee,
+							"pay_time":      pay_time,
+							"order_status":  1,
+							"vip_starttime": qutil.FormatDate(&starttime, qutil.Date_Full_Layout),
+							"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
+						})
+						if update {
+							ok = true
+						}
+					}
+					area := *vmsg.Area
+					industry := vmsg.Industry
+					validtime := qutil.Int64All(effect)
+					if util.MQFW.Save("vip_upgrade",
+						bson.M{
+							"s_userid":     userid,            //试用设置地区
+							"a_buyerclass": industry,          //试用设置行业
+							"o_area":       area,              //购买内容 城市、省份、行业数量
+							"l_validtime":  validtime,         //生效时间
+							"l_createtime": time.Now().Unix(), //入库时间
+							"i_isvalid":    0,                 //是否已经生效 0-未生效
+						}) == "" {
+						ok = true
+					}
+				}
 			}
-			update := util.Mysql.Update("dataexport_order", map[string]interface{}{
-				"order_status": 0,
-				"out_trade_no": param.OutTradeno,
-				"order_money":  param.TotalFee,
-				//"user_openid":  openid,
-			}, map[string]interface{}{
-				"pay_money":     param.CashFee,
-				"pay_time":      pay_time,
-				"order_status":  1,
-				"vip_starttime": qutil.FormatDate(&startTime, qutil.Date_Full_Layout),
-				"vip_endtime":   qutil.FormatDate(&endTime, qutil.Date_Full_Layout),
-			})
-			if update {
+			if ok {
 				//支付成功后 其他未支付vip订阅订单 变为已取消
 				if PayCancel(userid) {
 					log.Println(userid, "更改其余未支付订单失效")
 				}
-				if JyVipSubStruct.StartSubVip(userid, vmsg.Area, vmsg.Industry, startTime, endTime, false, vmsg.Cyclecount, vmsg.Cycleunit) {
-					ok = true
-				}
 			}
 		} else {
 			ok = true

+ 11 - 3
src/jfw/modules/subscribepay/src/service/vipRenewUpgrade.go

@@ -77,7 +77,6 @@ func (this *RenewUpgrade) GetRenewUpgradePrice() {
 		vipjy := (*data)["o_vipjy"].(map[string]interface{})
 		area := vipjy["o_area"]
 		buyerclass := vipjy["a_buyerclass"]
-
 		//
 		areaArr := qutil.ObjToMap(area)
 		buyerclassArr := qutil.ObjArrToStringArr(buyerclass.([]interface{}))
@@ -129,6 +128,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 	pay_source := this.GetString("pay_source")
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	openId := qutil.ObjToString(this.GetSession("s_m_openid"))
+	endtime := this.GetString("endtime")
+	log.Println("endtime", endtime)
 	r := func() *entity.FuncResult {
 		now := time.Now()
 		//数据校验
@@ -149,6 +150,9 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				if err != nil {
 					return &entity.FuncResult{false, err, nil}
 				}
+			} else {
+				pro_count = 0
+				pro_unit = 0
 			}
 		} else {
 			date_count, date_unit, err = checkReqDates(date)
@@ -195,6 +199,7 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 			totalfee = entity.JyVipSubStruct.GetSubVipPrice(area, industry, date_count, date_unit)
 		}
 		log.Println("price", totalfee)
+		totalfee = 1
 
 		//创建订单
 		tradeno, prepayid, payStr := "", "", ""
@@ -230,13 +235,14 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 		}
 		var filter interface{}
 		if effect != "" {
-			filter = entity.VipUpgradeMsg{
+			filter = entity.VipSimpleMsg{
 				mog_id,
 				area,
 				industry,
-				pay_source,
 				pro_count,
 				pro_unit,
+				pay_source,
+				endtime,
 				effect,
 			}
 		} else {
@@ -247,6 +253,8 @@ func (this *RenewUpgrade) RenewUpgradeCreateOrder() {
 				date_count,
 				date_unit,
 				pay_source,
+				endtime,
+				"",
 			}
 		}
 

+ 2 - 0
src/jfw/modules/subscribepay/src/service/vipSubscribePay.go

@@ -105,6 +105,8 @@ func (this *SubVipPayOrder) CreateOrder() {
 			date_count,
 			date_unit,
 			"open",
+			"",
+			"",
 		}
 		filterStr, _ := json.Marshal(filter)
 		ordercode := pay.GetOrderCode(userId)

+ 10 - 1
src/web/templates/weixin/vipsubscribe/renew_pay.html

@@ -624,17 +624,26 @@
 	    		"time": $('.choose_item.select_cycle .info').attr('placeholder'),
 	    		"payWay":"wx_js",
 	    		"pay_source": "Renew",
+	    		"endtime": ends,
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
                 if(r.success){
-//                  clearSessionStorage();
+                    clearSessionStorage();
                     onBridgeReady(JSON.parse(r.data.res),r.data.code);
                 }
                 $("#payHandle").removeAttr("disabled")  
             })
 	    });
 	    
+	    //
+	    function clearSessionStorage(){
+	    	sessionStorage.removeItem("renew_cyclecount");
+	    	sessionStorage.removeItem("renew_cycleunit");
+	    	sessionStorage.removeItem("renew_price");
+	    	sessionStorage.removeItem("renew_finally_price");
+	    }
+	    
     </script>
 </body>
 

+ 21 - 2
src/web/templates/weixin/vipsubscribe/vip_upgrade.html

@@ -992,7 +992,17 @@
         	let effective = $("#effect_date_name").text();
         	var effect = "now";
         	if(effective !== "立即生效,需支付当月费用差价"){
-        		effect = "notnow";
+        		let nowDate = new Date().toLocaleDateString();
+				nowDate = nowDate.split("/");
+				let nowMonth = Number(nowDate[1]);
+				let nowYear = Number(nowDate[0]);
+				let a = nowMonth +1
+        		if(a > 12){
+        			a = nowMonth-12;
+        			nowYear = nowYear +1;
+        		}
+        		let b = nowYear+"/"+a+"/1";
+        		effect = new Date(b).getTime() /1000;
         	}
         	let areas = areasArr;
         	let industrys = industrysArr;
@@ -1016,16 +1026,25 @@
 	    		"pay_source" : "Upgrade",
 	    		"time": times,
 	    		"price": Number(price),
+	    		"endtime": ends,
 	    	}
 	    	console.log(param)
 	    	$DoPost("/subscribepay/renewUpgrade/renewUpgradeCreateOrder",param,function(r){
                 if(r.success){
-//                  clearSessionStorage();
+                    clearSessionStorage();
                     onBridgeReady(JSON.parse(r.data.res),r.data.code);
                 }
                 $("#payHandle").removeAttr("disabled");
             })
 	    });
+	    
+	    //
+	    function clearSessionStorage(){
+	    	sessionStorage.removeItem("renew_cyclecount");
+	    	sessionStorage.removeItem("renew_cycleunit");
+	    	sessionStorage.removeItem("renew_price");
+	    	sessionStorage.removeItem("renew_finally_price");
+	    }
     </script>
 </body>