|
@@ -310,28 +310,26 @@ func delPower(id int64) {
|
|
|
set["l_vip_endtime"] = time.Now().Unix()
|
|
|
set["i_vip_status"] = 0
|
|
|
} else if strings.Contains(productType, "大会员") || productType == YYSZSYY {
|
|
|
- go func() {
|
|
|
- res := JyMysql.SelectBySql("SELECT b.s_name,b.s_count_year,a.l_endtime FROM bigmember_service_user a INNER JOIN bigmember_service b on (a.s_serviceid = b.id and b.s_name LIKE '%pdf下载%' WHERE a.s_userid = ? and i_status = 1 and l_endtime >? ", common.InterfaceToStr(identity.PositionId), time.Now().Format("2006-01-02 15:04:05"))
|
|
|
- if res != nil {
|
|
|
- for _, serverData := range *res {
|
|
|
- var (
|
|
|
- resourceType string
|
|
|
- )
|
|
|
- if strings.Contains(common.InterfaceToStr(serverData["s_name"]), "市场分析定制报告pdf下载") {
|
|
|
- resourceType = "市场分析定制报告下载包"
|
|
|
- } else if strings.Contains(common.InterfaceToStr(serverData["s_name"]), "业主采购分析报告pdf下载") {
|
|
|
- resourceType = "业主采购分析报告下载包"
|
|
|
- } else if strings.Contains(common.InterfaceToStr(serverData["s_name"]), "企业中标分析报告pdf下载") {
|
|
|
- resourceType = "企业中标分析报告下载包"
|
|
|
- }
|
|
|
- if resourceType != "" {
|
|
|
- if err := DelPdfPack(common.InterfaceToStr(identity.PositionId), resourceType, entId); err != nil {
|
|
|
- log.Println("AddPdfPack err ", err)
|
|
|
- }
|
|
|
+ res := JyMysql.SelectBySql("SELECT b.s_name,b.s_count_year,a.l_endtime FROM bigmember_service_user a INNER JOIN bigmember_service b on (a.s_serviceid = b.id and b.s_name LIKE '%pdf下载%') WHERE a.s_userid = ? and a.i_status >= 0 and l_endtime >? ", common.InterfaceToStr(identity.PositionId), time.Now().Format("2006-01-02 15:04:05"))
|
|
|
+ if res != nil {
|
|
|
+ for _, serverData := range *res {
|
|
|
+ var (
|
|
|
+ resourceType string
|
|
|
+ )
|
|
|
+ if strings.Contains(common.InterfaceToStr(serverData["s_name"]), "市场分析定制报告pdf下载") {
|
|
|
+ resourceType = "市场分析定制报告下载包"
|
|
|
+ } else if strings.Contains(common.InterfaceToStr(serverData["s_name"]), "业主采购分析报告pdf下载") {
|
|
|
+ resourceType = "业主采购分析报告下载包"
|
|
|
+ } else if strings.Contains(common.InterfaceToStr(serverData["s_name"]), "企业中标分析报告pdf下载") {
|
|
|
+ resourceType = "企业中标分析报告下载包"
|
|
|
+ }
|
|
|
+ if resourceType != "" {
|
|
|
+ if err := DelPdfPack(common.InterfaceToStr(identity.PositionId), resourceType, entId); err != nil {
|
|
|
+ log.Println("DelPdfPack err ", err)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }()
|
|
|
+ }
|
|
|
|
|
|
set["i_member_endtime"] = time.Now().Unix()
|
|
|
set["i_member_status"] = 0
|
|
@@ -486,32 +484,31 @@ func memberSetMap(userId int64, orderData map[string]interface{}) (set map[strin
|
|
|
}
|
|
|
if resourceType != "" {
|
|
|
number := common.IntAll((*serverData)["s_count_year"])
|
|
|
- comboId := common.IntAll((*filterMap)["comboId"])
|
|
|
- if comboId > 0 { //套餐 number*时间
|
|
|
- cycle := common.IntAll((*filterMap)["cycle"]) //购买时长
|
|
|
- cycleType := common.IntAll((*filterMap)["cycleType"]) //时间类型
|
|
|
- cycleFmt := common.If(cycleType == 0, 12, 366).(int)
|
|
|
- if tm := cycle / cycleFmt; tm > 0 {
|
|
|
- number = number * tm
|
|
|
- }
|
|
|
+ cycle := common.IntAll((*filterMap)["cycle"]) //购买时长
|
|
|
+ cycleType := common.IntAll((*filterMap)["cycleType"]) //时间类型
|
|
|
+ cycleFmt := common.If(cycleType == 0, 12, 366).(int)
|
|
|
+ if tm := cycle / cycleFmt; tm > 0 {
|
|
|
+ number = number * tm
|
|
|
}
|
|
|
-
|
|
|
+ frequency = number
|
|
|
if err := AddPdfPack(common.InterfaceToStr(userId), resourceType, common.Int64All(orderData["ent_id"])); err != nil {
|
|
|
log.Println("AddPdfPack err ", err)
|
|
|
}
|
|
|
}
|
|
|
- if serverId == 11 || serverId == 15 {
|
|
|
- if serverId == 15 {
|
|
|
- if payCycle >= 12 {
|
|
|
- frequency = (payCycle / 12 * common.IntAll((*serverData)["s_count_year"])) + (payCycle % 12 * common.IntAll((*serverData)["s_count_month"]))
|
|
|
+ if frequency == 0 {
|
|
|
+ if serverId == 11 || serverId == 15 {
|
|
|
+ if serverId == 15 {
|
|
|
+ if payCycle >= 12 {
|
|
|
+ frequency = (payCycle / 12 * common.IntAll((*serverData)["s_count_year"])) + (payCycle % 12 * common.IntAll((*serverData)["s_count_month"]))
|
|
|
+ } else {
|
|
|
+ frequency = payCycle * common.IntAll((*serverData)["s_count_month"])
|
|
|
+ }
|
|
|
} else {
|
|
|
frequency = payCycle * common.IntAll((*serverData)["s_count_month"])
|
|
|
}
|
|
|
} else {
|
|
|
- frequency = payCycle * common.IntAll((*serverData)["s_count_month"])
|
|
|
+ frequency = common.IntAll((*serverData)["s_count_month"])
|
|
|
}
|
|
|
- } else {
|
|
|
- frequency = common.IntAll((*serverData)["s_count_month"])
|
|
|
}
|
|
|
}
|
|
|
sqls := "select * from bigmember_service_user where s_serviceid = ? and s_userid = ? and i_status = -1"
|
|
@@ -566,33 +563,25 @@ func memberSetMap(userId int64, orderData map[string]interface{}) (set map[strin
|
|
|
resourceType = "企业中标分析报告下载包"
|
|
|
}
|
|
|
if resourceType != "" {
|
|
|
- number := common.IntAll((*serverData)["s_count_year"])
|
|
|
- comboId := common.IntAll((*filterMap)["comboId"])
|
|
|
- if comboId > 0 { //套餐 number*时间
|
|
|
- cycle := common.IntAll((*filterMap)["cycle"]) //购买时长
|
|
|
- cycleType := common.IntAll((*filterMap)["cycleType"]) //时间类型
|
|
|
- cycleFmt := common.If(cycleType == 0, 12, 366).(int)
|
|
|
- if tm := cycle / cycleFmt; tm > 0 {
|
|
|
- number = number * tm
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ frequency = common.IntAll((*serverData)["s_count_year"])
|
|
|
if err := AddPdfPack(common.InterfaceToStr(userId), resourceType, common.Int64All(orderData["ent_id"])); err != nil {
|
|
|
log.Println("AddPdfPack err ", err)
|
|
|
}
|
|
|
}
|
|
|
- if serverId == 11 || serverId == 15 {
|
|
|
- if serverId == 15 {
|
|
|
- if payCycle >= 12 {
|
|
|
- frequency = (payCycle / 12 * common.IntAll((*serverData)["s_count_year"])) + (payCycle % 12 * common.IntAll((*serverData)["s_count_month"]))
|
|
|
+ if frequency == 0 {
|
|
|
+ if serverId == 11 || serverId == 15 {
|
|
|
+ if serverId == 15 {
|
|
|
+ if payCycle >= 12 {
|
|
|
+ frequency = (payCycle / 12 * common.IntAll((*serverData)["s_count_year"])) + (payCycle % 12 * common.IntAll((*serverData)["s_count_month"]))
|
|
|
+ } else {
|
|
|
+ frequency = payCycle * common.IntAll((*serverData)["s_count_month"])
|
|
|
+ }
|
|
|
} else {
|
|
|
frequency = payCycle * common.IntAll((*serverData)["s_count_month"])
|
|
|
}
|
|
|
} else {
|
|
|
- frequency = payCycle * common.IntAll((*serverData)["s_count_month"])
|
|
|
+ frequency = common.IntAll((*serverData)["s_count_month"])
|
|
|
}
|
|
|
- } else {
|
|
|
- frequency = common.IntAll((*serverData)["s_count_month"])
|
|
|
}
|
|
|
}
|
|
|
sqls := "select * from bigmember_service_user where s_serviceid = ? and s_userid = ? and i_status = -1"
|