|
@@ -125,7 +125,7 @@ func ServiceOpen(context *admin.Context) (interface{}, error) {
|
|
|
return nil, err
|
|
|
}
|
|
|
var vipStartTime, vipEndTime time.Time
|
|
|
- vipStartTime, vipEndTime = GetStartAndEndTime(time.Unix(param.StartTime, 0).Format(cm.Date_Full_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
+ vipStartTime, vipEndTime = GetStartAndEndTime(time.Unix(param.StartTime, 0).Format(cm.Date_Short_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
VipServiceOpen(userId, param.Phone, filterMap, vipStartTime, vipEndTime, cm.IntAll((*order)["buy_subject"]), entId)
|
|
|
updateMap["vip_starttime"] = vipStartTime.Format(cm.Date_Full_Layout)
|
|
|
updateMap["vip_endtime"] = vipEndTime.Format(cm.Date_Full_Layout)
|
|
@@ -357,7 +357,7 @@ func GetStartAndEndTime(startTime string, cycleCount, cycleUnit int) (vipStartTi
|
|
|
} else if cycleUnit == 4 {
|
|
|
month = cycleCount * 3
|
|
|
}
|
|
|
- vipStartTime, _ = time.ParseInLocation(cm.Date_Short_Layout, startTime, time.Local)
|
|
|
+ vipStartTime, _ = time.Parse(cm.Date_Short_Layout, startTime)
|
|
|
if cycleUnit == 3 {
|
|
|
_endTime := vipStartTime.AddDate(0, 0, cycleCount)
|
|
|
t := _endTime.Format(cm.Date_Short_Layout) + " 23:59:59"
|
|
@@ -398,7 +398,7 @@ func OpenUserService(tx *sql.Tx, orderCode string, orderInfo map[string]interfac
|
|
|
if productType == "VIP订阅" {
|
|
|
vipType := cm.IntAll(orderInfo["vip_type"])
|
|
|
if vipType == 0 {
|
|
|
- vipStartTime, vipEndTime := GetStartAndEndTime(time.Now().Format(cm.Date_Full_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
+ vipStartTime, vipEndTime := GetStartAndEndTime(time.Now().Format(cm.Date_Short_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
VipServiceOpen(userId, cm.ObjToString(orderInfo["user_phone"]), filterMap, vipStartTime, vipEndTime, cm.IntAll(orderInfo["buy_subject"]), cm.IntAll(orderInfo["ent_id"]))
|
|
|
updateOrder["vip_starttime"] = vipStartTime.Format(cm.Date_Full_Layout)
|
|
|
updateOrder["vip_endtime"] = vipEndTime.Format(cm.Date_Full_Layout)
|
|
@@ -414,16 +414,6 @@ func OpenUserService(tx *sql.Tx, orderCode string, orderInfo map[string]interfac
|
|
|
"i_vip_status": 2,
|
|
|
}
|
|
|
if vipEndTime.Unix() < time.Now().Unix() { //原服务已过期
|
|
|
- //查询回款记录,最近一笔回款时间
|
|
|
- /*newReturnMoneyTime, checkPassTime, err := GetReturnTimeAndCheckTime(orderCode)
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
- if newReturnMoneyTime.Unix() > checkPassTime.Unix() {
|
|
|
- newStartTime = newReturnMoneyTime
|
|
|
- } else {
|
|
|
- newStartTime = checkPassTime
|
|
|
- }*/
|
|
|
newStartTime = time.Now()
|
|
|
set["l_vip_starttime"] = newStartTime.Unix()
|
|
|
|
|
@@ -431,8 +421,8 @@ func OpenUserService(tx *sql.Tx, orderCode string, orderInfo map[string]interfac
|
|
|
//开始时间为:原服务结束日期+1天
|
|
|
newStartTime = vipEndTime.AddDate(0, 0, 1)
|
|
|
}
|
|
|
+ _, newEndTime = GetStartAndEndTime(newStartTime.Format(cm.Date_Short_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
set["l_vip_endtime"] = newEndTime.Unix()
|
|
|
- _, newEndTime = GetStartAndEndTime(newStartTime.Format(cm.Date_Full_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
if !util.MQFW.UpdateById("user", userId,
|
|
|
bson.M{"$set": set}) {
|
|
|
return errors.New(fmt.Sprintf("%s更新结束%d日期出错", userId, vipEndTime.Unix()))
|