|
@@ -431,6 +431,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_Short_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
if cm.IntAll(orderInfo["buy_subject"]) == 2 { //购买主体是企业,手机号改变,需要重新创建企业
|
|
|
entId, err, userPositionId = AutomaticallyCreatingEnt(cm.ObjToString(orderInfo["company_name"]), cm.ObjToString(orderInfo["user_phone"]), orderCode, 1, userId)
|
|
|
if err != nil {
|
|
@@ -438,19 +439,16 @@ func OpenUserService(tx *sql.Tx, orderCode string, orderInfo map[string]interfac
|
|
|
return err
|
|
|
}
|
|
|
userId = userPositionId
|
|
|
- }
|
|
|
- vipStartTime, vipEndTime := GetStartAndEndTime(time.Now().Format(cm.Date_Short_Layout), cm.IntAll(filterMap["cyclecount"]), cm.IntAll(filterMap["cycleunit"]))
|
|
|
- if cm.IntAll(orderInfo["buy_subject"]) == 2 {
|
|
|
var (
|
|
|
entService bool
|
|
|
userCount int
|
|
|
)
|
|
|
entService, userCount = EntServiceOpen(entId, cm.ObjToString(orderInfo["user_phone"]), cm.ObjToString(orderInfo["product_type"]), vipStartTime.Unix())
|
|
|
orderId := cm.IntAll(orderInfo["id"])
|
|
|
- if cm.IntAll(entId) != 0 && cm.IntAll(orderInfo["buy_count"]) > 0 {
|
|
|
+ if entId != 0 && cm.IntAll(orderInfo["buy_count"]) > 0 {
|
|
|
regRuler := "^1[3456789]{1}\\d{9}$"
|
|
|
reg := regexp.MustCompile(regRuler)
|
|
|
- if cm.IntAll(orderInfo["order_status"]) == 1 && reg.MatchString(cm.ObjToString(orderInfo["user_phone"])) && cm.ObjToString(orderInfo["company_name"]) != "" {
|
|
|
+ if reg.MatchString(cm.ObjToString(orderInfo["user_phone"])) && cm.ObjToString(orderInfo["company_name"]) != "" {
|
|
|
newBuySet := cm.ObjToMap(filterMap["newBuyset"])
|
|
|
if newBuySet == nil {
|
|
|
return errors.New("filtermap newBuyset字段为空")
|
|
@@ -531,6 +529,7 @@ func OpenUserService(tx *sql.Tx, orderCode string, orderInfo map[string]interfac
|
|
|
//清理缓存
|
|
|
go ClearBigVipUserPower(userId)
|
|
|
}
|
|
|
+ updateOrder["vip_starttime"] = time.Now().Format(cm.Date_Full_Layout)
|
|
|
}
|
|
|
}
|
|
|
|