|
@@ -1,11 +1,11 @@
|
|
|
package activity
|
|
|
|
|
|
import (
|
|
|
+ "app.yhyue.com/moapp/jybase/common"
|
|
|
"app.yhyue.com/moapp/jybase/go-logger/logger"
|
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
|
"app.yhyue.com/moapp/message/db"
|
|
|
"app.yhyue.com/moapp/message/handler/award"
|
|
|
- "app.yhyue.com/moapp/message/rpc"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/v2/os/gcfg"
|
|
@@ -141,10 +141,10 @@ type FreeSubscribe struct {
|
|
|
|
|
|
// MissionsSubscribeQuery 订阅任务
|
|
|
// status:0 未完成 1 待领取 -1已领取
|
|
|
+// 付费账户直接视为完成任务
|
|
|
func (BP *BidderPlan) MissionsSubscribeQuery(userId string) (status int) {
|
|
|
- //非7天超级订阅或存在订阅内容则完成任务
|
|
|
finish := func() bool {
|
|
|
- uData, ok := db.Mgo.FindById("user", userId, `{"o_jy":1,"i_vip_status":1,"i_member_status":1}`)
|
|
|
+ uData, ok := db.Mgo.FindById("user", userId, `{"o_jy":1,"i_vip_status":1,"i_member_status":1,"s_m_phone":1,"s_phone:1"}`)
|
|
|
if !ok || uData == nil || len(*uData) == 0 {
|
|
|
return false
|
|
|
}
|
|
@@ -153,27 +153,27 @@ func (BP *BidderPlan) MissionsSubscribeQuery(userId string) (status int) {
|
|
|
} else if gconv.Int((*uData)["i_member_status"]) > 0 { //大会员
|
|
|
return true
|
|
|
}
|
|
|
- //查询免费订阅是否完成
|
|
|
- vStatus, err := rpc.GetUserVipBaseMsgByRpc(userId)
|
|
|
- if err != nil {
|
|
|
+ //查询是否是商机管理用户
|
|
|
+ phone, _ := common.If((*uData)["s_phone"] != nil, (*uData)["s_phone"], (*uData)["s_m_phone"]).(string)
|
|
|
+ if phone != "" {
|
|
|
+ if count := db.Mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //免费用户查询是否完成订阅
|
|
|
+ bytes := gconv.Bytes((*uData)["o_jy"])
|
|
|
+ if bytes == nil || len(bytes) == 0 {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ freeSub := FreeSubscribe{}
|
|
|
+ if err := json.Unmarshal(bytes, &freeSub); err != nil {
|
|
|
+ logger.Error("MissionsSubscribeQuery 格式化订阅内存出错", err)
|
|
|
return false
|
|
|
}
|
|
|
- if vStatus.EntnicheStatus > 0 {
|
|
|
+ if len(freeSub.AKey) > 0 && len(freeSub.OAreaP) > 0 {
|
|
|
return true
|
|
|
- } else {
|
|
|
- bytes := gconv.Bytes((*uData)["o_jy"])
|
|
|
- if bytes == nil || len(bytes) == 0 {
|
|
|
- return false
|
|
|
- }
|
|
|
- freeSub := FreeSubscribe{}
|
|
|
- if err = json.Unmarshal(bytes, &freeSub); err != nil {
|
|
|
- fmt.Println(err)
|
|
|
- return false
|
|
|
- }
|
|
|
- if len(freeSub.AKey) > 0 && len(freeSub.OAreaP) > 0 {
|
|
|
- return true
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
return false
|
|
|
}()
|
|
|
|