|
@@ -3786,7 +3786,7 @@ func NewBigOrder(subStatus, dateType int, startdate, enddate time.Time, userId,
|
|
|
})
|
|
|
// 企业主体判断是否开通权益
|
|
|
if param.BuySubject == "2" {
|
|
|
- entService, userCount = EntServiceOpen(qutil.IntAll(paramOrder["entId"]), param.BuySubject, param.StartTime)
|
|
|
+ entService, userCount = EntServiceOpen(qutil.IntAll(paramOrder["entId"]), "1", param.StartTime)
|
|
|
_d := util.JysqlDB.FindOne("dataexport_order", map[string]interface{}{"order_code": code}, "id", "")
|
|
|
if _d != nil && len(*_d) > 0 {
|
|
|
orderId := qutil.IntAll((*_d)["id"])
|
|
@@ -4086,6 +4086,7 @@ func NewBigOrder(subStatus, dateType int, startdate, enddate time.Time, userId,
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+// subject 0 超级订阅 1大会员
|
|
|
func EntServiceOpen(entId int, subject string, st int64) (bool, int) {
|
|
|
if st == 4070880000 {
|
|
|
return false, 0
|
|
@@ -4096,13 +4097,25 @@ func EntServiceOpen(entId int, subject string, st int64) (bool, int) {
|
|
|
return false, 0
|
|
|
}
|
|
|
}*/
|
|
|
- data, _ := util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
|
+ data, _ := util.MQFW.FindOne("ent_user", map[string]interface{}{
|
|
|
"i_userid": map[string]interface{}{
|
|
|
"$exists": false,
|
|
|
},
|
|
|
"i_entid": entId,
|
|
|
})
|
|
|
- if qutil.Int64All((*data)["l_endtime"]) < time.Now().Local().Unix() {
|
|
|
+ var status, isTime bool
|
|
|
+ if subject == "1" {
|
|
|
+ status = qutil.Int64All((*data)["i_member_status"]) > 0
|
|
|
+ if endtime, ok := (*data)["l_member_endtime"]; ok && qutil.Int64All(endtime) >= time.Now().Local().Unix() {
|
|
|
+ isTime = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ status = qutil.Int64All((*data)["i_vip_status"]) > 0
|
|
|
+ if endtime, ok := (*data)["l_vip_endtime"]; ok && qutil.Int64All(endtime) >= time.Now().Local().Unix() {
|
|
|
+ isTime = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if status && isTime {
|
|
|
return false, 0
|
|
|
}
|
|
|
return true, 1
|
|
@@ -4243,7 +4256,7 @@ func UpdateNewBigOrder(subStatus, dateType int, now, startdate, enddate time.Tim
|
|
|
)
|
|
|
//主体为企业
|
|
|
if param.BuySubject == "2" {
|
|
|
- entService, userCount = EntServiceOpen(qutil.IntAll(paramOrder["entId"]), param.BuySubject, param.StartTime)
|
|
|
+ entService, userCount = EntServiceOpen(qutil.IntAll(paramOrder["entId"]), "1", param.StartTime)
|
|
|
_d := util.JysqlDB.FindOne("dataexport_order", map[string]interface{}{"order_code": param.OrderCode}, "id", "")
|
|
|
if _d != nil && len(*_d) > 0 {
|
|
|
orderId := qutil.IntAll((*_d)["id"])
|