|
@@ -6,8 +6,6 @@ import (
|
|
"entity"
|
|
"entity"
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
- "github.com/go-xweb/xweb"
|
|
|
|
- "go.mongodb.org/mongo-driver/bson"
|
|
|
|
"log"
|
|
"log"
|
|
"math"
|
|
"math"
|
|
"pay"
|
|
"pay"
|
|
@@ -16,6 +14,9 @@ import (
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
"util"
|
|
"util"
|
|
|
|
+
|
|
|
|
+ "github.com/go-xweb/xweb"
|
|
|
|
+ "go.mongodb.org/mongo-driver/bson"
|
|
)
|
|
)
|
|
|
|
|
|
//订阅修改 or 升级
|
|
//订阅修改 or 升级
|
|
@@ -131,6 +132,7 @@ func (this *SubscribeChange) Upgrade() {
|
|
now := time.Now()
|
|
now := time.Now()
|
|
date_count, date_unit, needRenew := 0, 0, false
|
|
date_count, date_unit, needRenew := 0, 0, false
|
|
endUnix := qutil.Int64All((*rData)["l_vip_endtime"])
|
|
endUnix := qutil.Int64All((*rData)["l_vip_endtime"])
|
|
|
|
+ startUnix := qutil.Int64All((*rData)["l_vip_starttime"])
|
|
|
|
|
|
if timeRenew != "" {
|
|
if timeRenew != "" {
|
|
var err error
|
|
var err error
|
|
@@ -260,6 +262,13 @@ func (this *SubscribeChange) Upgrade() {
|
|
if orderid == -1 {
|
|
if orderid == -1 {
|
|
return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
|
|
return &entity.FuncResult{false, errors.New("数据库操作异常"), nil}
|
|
}
|
|
}
|
|
|
|
+ //老用户升级 一个省 全行业 时间不变 会出现零元升级得情况 0元升级直接到支付成功页面 开通超级订阅
|
|
|
|
+ if req_price == 0 && 0 == final_price && oldBuyset.Upgrade == 0 {
|
|
|
|
+ if !entity.JyVipSubStruct.StartSubVip(userId, filter, time.Unix(startUnix, 0), time.Unix(endUnix, 0), false) { //设置开始试用
|
|
|
|
+ return &entity.FuncResult{false, errors.New("老用户升级超级订阅高版本异常"), nil}
|
|
|
|
+ }
|
|
|
|
+ return &entity.FuncResult{true, nil, map[string]interface{}{"code": ordercode, "needPay": false}}
|
|
|
|
+ }
|
|
//绑定卡卷
|
|
//绑定卡卷
|
|
if userLotteryId != "" && lotteryId != "" {
|
|
if userLotteryId != "" && lotteryId != "" {
|
|
go func(userId, userLotteryId, order_code string) {
|
|
go func(userId, userLotteryId, order_code string) {
|