|
@@ -713,17 +713,29 @@ func FortyEightHoursCancel(order string, create_time_stamp, now_time_stamp int64
|
|
|
func isEntExpire(userid string) bool {
|
|
|
u, ok := util.MQFW.FindById("user", userid, `{"s_phone":1}`)
|
|
|
if ok && u != nil && (*u)["s_phone"] != nil {
|
|
|
- list := util.Mysql.SelectBySql(`SELECT DISTINCT a.id,a.name,a.phone,a.startdate,a.enddate from entniche_info a
|
|
|
- INNER JOIN entniche_user b on (a.id=b.ent_id)
|
|
|
- where a.phone=? or b.phone=?
|
|
|
- order by convert(a.name using gbk) COLLATE gbk_chinese_ci asc`, (*u)["s_phone"].(string), (*u)["s_phone"].(string))
|
|
|
- if list != nil {
|
|
|
+ // list := util.Mysql.SelectBySql(`SELECT DISTINCT a.id,a.name,a.phone,a.startdate,a.enddate from entniche_info a
|
|
|
+ // INNER JOIN entniche_user b on (a.id=b.ent_id)
|
|
|
+ // where a.phone=? or b.phone=?
|
|
|
+ // order by convert(a.name using gbk) COLLATE gbk_chinese_ci asc`, (*u)["s_phone"].(string), (*u)["s_phone"].(string))
|
|
|
+ list := util.Mysql.SelectBySql(`select filter from dataexport_order where user_id=? and product_type=? and order_status=?`, userid, "企业商机管理", 1)
|
|
|
+ if len(*list) > 0 {
|
|
|
for _, v := range *list {
|
|
|
- startdate := qutil.Int64All(v["startdate"])
|
|
|
- enddate := qutil.Int64All(v["enddate"])
|
|
|
- now := time.Now().Unix()
|
|
|
- if now >= startdate && now < enddate {
|
|
|
- return true
|
|
|
+ filterStr := qutil.ObjToString(v["filter"])
|
|
|
+ var filter map[string]interface{}
|
|
|
+ if err := json.Unmarshal([]byte(filterStr), &filter); err != nil {
|
|
|
+ log.Printf("%s 判断用户购买的企业商机管理是否到期 isEntExpire Unmarshal 出错 [%s]\n", userid, filterStr)
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ date := util.Mysql.FindOne("entniche_info", bson.M{"name": qutil.ObjToString(filter["entname"])}, "startdate,enddate", "")
|
|
|
+ log.Println(date)
|
|
|
+ if date != nil {
|
|
|
+ startdate := qutil.Int64All((*date)["startdate"])
|
|
|
+ enddate := qutil.Int64All((*date)["enddate"])
|
|
|
+ log.Println(startdate)
|
|
|
+ now := time.Now().Unix()
|
|
|
+ if now >= startdate && now < enddate {
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|