|
@@ -88,6 +88,23 @@ func ClearBigVipUserPower(userId string) bool {
|
|
|
cacheKey := fmt.Sprintf(PowerCacheKey, userId)
|
|
|
return redis.Del(PowerCacheDb, cacheKey)
|
|
|
}
|
|
|
+//获取商机管理个人基本信息
|
|
|
+func GetEntnicheState(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
|
|
|
+ userPower := BigVipBaseMsg{}
|
|
|
+ userPower.EntnicheStatus = 0
|
|
|
+ //手机号
|
|
|
+ data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
|
|
|
+ if ok && *data != nil && len(*data) > 0 {
|
|
|
+ //查询是否是商机管理付费用户
|
|
|
+ phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
|
|
|
+ if phone != "" {
|
|
|
+ if count := 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 {
|
|
|
+ userPower.EntnicheStatus = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return &userPower
|
|
|
+}
|
|
|
|
|
|
//获取大会员个人基本信息
|
|
|
func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
|