|
@@ -1200,6 +1200,17 @@ func VipInfo(context *admin.Context) (interface{}, error) {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
var willEffect bool
|
|
var willEffect bool
|
|
|
|
+ if param.BuySubject == "1" {
|
|
|
|
+ count := util.JysqlDB.CountBySql("SELECT count(1) FROM dataexport_order WHERE product_type = 'VIP订阅' AND user_phone = ? AND vip_starttime > ?", param.Phone, time.Now().Format(qutil.Date_Full_Layout))
|
|
|
|
+ if count > 0 {
|
|
|
|
+ return map[string]interface{}{
|
|
|
|
+ "willEffect": true,
|
|
|
|
+ "userData": nil,
|
|
|
|
+ "vipExist": false,
|
|
|
|
+ }, nil
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//先判断用户是否有即将生效的超级订阅订单
|
|
//先判断用户是否有即将生效的超级订阅订单
|
|
query := map[string]interface{}{
|
|
query := map[string]interface{}{
|
|
"s_phone": param.Phone,
|
|
"s_phone": param.Phone,
|
|
@@ -1256,16 +1267,6 @@ func VipInfo(context *admin.Context) (interface{}, error) {
|
|
}
|
|
}
|
|
if userInfo != nil && len(userInfo) > 0 {
|
|
if userInfo != nil && len(userInfo) > 0 {
|
|
userId := mongodb.BsonIdToSId(userInfo["_id"])
|
|
userId := mongodb.BsonIdToSId(userInfo["_id"])
|
|
- if param.BuySubject == "1" {
|
|
|
|
- count := util.JysqlDB.CountBySql("SELECT * FROM dataexport_order WHERE product_type = 'VIP订阅' AND user_id = ? AND vip_starttime > ?", userId, time.Now().Format(qutil.Date_Full_Layout))
|
|
|
|
- if count > 0 {
|
|
|
|
- return map[string]interface{}{
|
|
|
|
- "willEffect": true,
|
|
|
|
- "userData": userInfo,
|
|
|
|
- "vipExist": false,
|
|
|
|
- }, nil
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
//查询订单信息获取客户名称
|
|
//查询订单信息获取客户名称
|
|
orderInfo := util.JysqlDB.SelectBySql("SELECT c.customer_name,d.company_name FROM dataexport_order d LEFT JOIN contract c ON c.order_code = d.order_code WHERE product_type = 'VIP订阅' and user_id = ? ORDER BY d.id DESC", userId)
|
|
orderInfo := util.JysqlDB.SelectBySql("SELECT c.customer_name,d.company_name FROM dataexport_order d LEFT JOIN contract c ON c.order_code = d.order_code WHERE product_type = 'VIP订阅' and user_id = ? ORDER BY d.id DESC", userId)
|