|
@@ -4,31 +4,26 @@ import (
|
|
|
"database/sql"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
-<<<<<<< HEAD
|
|
|
+ utils "jy/src/jfw/modules/app/src/app/jyutil"
|
|
|
"jy/src/jfw/modules/app/src/jfw/config"
|
|
|
-=======
|
|
|
- "jfw/config"
|
|
|
- "qfw/util/fsw"
|
|
|
->>>>>>> master
|
|
|
"regexp"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
"app.yhyue.com/moapp/jybase/encrypt"
|
|
|
- utils "jy/src/jfw/modules/app/src/app/jyutil"
|
|
|
- //"math/rand"
|
|
|
- "log"
|
|
|
+ "app.yhyue.com/moapp/jybase/fsw"
|
|
|
|
|
|
+ //"math/rand"
|
|
|
. "jy/src/jfw/modules/app/src/app/jyutil"
|
|
|
+ "log"
|
|
|
|
|
|
util "app.yhyue.com/moapp/jybase/common"
|
|
|
elastic "app.yhyue.com/moapp/jybase/esv1"
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
|
"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
|
|
|
"app.yhyue.com/moapp/jypkg/public"
|
|
|
-
|
|
|
- "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
)
|
|
|
|
|
|
type Short struct {
|
|
@@ -52,21 +47,12 @@ func (s *Short) Article(stype, id string) error {
|
|
|
// return s.Redirect("/jyapp/free/swordfish/about", 302)
|
|
|
//}
|
|
|
disWord := s.GetString("disWord")
|
|
|
-<<<<<<< HEAD
|
|
|
- belongUserId := GetbelongUserId(disWord, userId)
|
|
|
- b, _ := redis.Exists("sso", "req_"+userId)
|
|
|
- if b {
|
|
|
- return s.Redirect("/jyapp/free/mob/err")
|
|
|
- }
|
|
|
- userPower := jy.GetBigVipUserBaseMsg( s.Session(), *config.Middleground)
|
|
|
-=======
|
|
|
->>>>>>> master
|
|
|
+ userPower := jy.GetBigVipUserBaseMsg(s.Session(), *config.Middleground)
|
|
|
var (
|
|
|
belongUserId, email string
|
|
|
|
|
|
isEntnicheNew, isOldVip, isVip, isMember, isEntniche, isEntService bool
|
|
|
)
|
|
|
- userPower := new(jy.BigVipBaseMsg)
|
|
|
//userId = "637dcf3ff143ed326e9e1589"
|
|
|
//登录用户 权限
|
|
|
if userId != "" {
|
|
@@ -75,8 +61,6 @@ func (s *Short) Article(stype, id string) error {
|
|
|
if b {
|
|
|
return s.Redirect("/jyapp/free/mob/err")
|
|
|
}
|
|
|
- userPower = jy.GetBigVipUserBaseMsg(userId, public.Mysql, public.MQFW)
|
|
|
-
|
|
|
isEntnicheNew = userPower.EntIsNew //新版超级订阅
|
|
|
isOldVip = false //新购超级订阅不能查看拟建项目详情页
|
|
|
isVip = userPower.VipStatus > 0 //超级订阅
|
|
@@ -183,13 +167,8 @@ func (s *Short) Article(stype, id string) error {
|
|
|
s.T["canRead"] = canRead
|
|
|
}
|
|
|
if canRead {
|
|
|
-<<<<<<< HEAD
|
|
|
- if belongUserId != "" && belongUserId != userId && util.ObjToString(obj["subtype"]) != "拟建" { //分享开打的
|
|
|
- article_id := encrypt.CommonDecodeArticle(stype, id)[0]
|
|
|
-=======
|
|
|
if belongUserId != "" && belongUserId != userId && util.ObjToString(obj["subtype"]) != "拟建" && userId != "" { //分享开打的
|
|
|
- article_id := util.CommonDecodeArticle(stype, id)[0]
|
|
|
->>>>>>> master
|
|
|
+ article_id := encrypt.CommonDecodeArticle(stype, id)[0]
|
|
|
key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, belongUserId, userId)
|
|
|
if redis.Incr("other", key) == 1 {
|
|
|
redis.SetExpire("other", key, 60*60*24)
|
|
@@ -277,19 +256,13 @@ func (s *Short) Article(stype, id string) error {
|
|
|
if userId != "" {
|
|
|
s.T["userId"] = se.Encode2Hex(userId) //加密用户userid
|
|
|
}
|
|
|
- s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail)
|
|
|
+ s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail, config.Sysconfig)
|
|
|
s.T["rewardText"], s.T["advertText"] = getRewardText()
|
|
|
s.T["advertImg"] = config.Sysconfig["advertImg"]
|
|
|
s.T["advertName"] = config.Sysconfig["advertName"]
|
|
|
s.T["advertUrl"] = config.Sysconfig["advertUrl"]
|
|
|
obj["industry"] = industry
|
|
|
-<<<<<<< HEAD
|
|
|
- obj["ucbsId"] = encrypt.EncodeArticleId2ByCheck("ucbs#" + userId + "#" + id)
|
|
|
- s.T["obj"] = obj
|
|
|
- s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail, config.Sysconfig)
|
|
|
-=======
|
|
|
s.T["obj"] = obj
|
|
|
->>>>>>> master
|
|
|
s.T["isIosExam"], s.T["isIosExamPhone"], _, _ = IosExamInfo(s.Action, false, false)
|
|
|
content, err := s.Render4Cache("/weixin/wxinfocontent.html", &s.T)
|
|
|
if err != nil {
|
|
@@ -326,8 +299,8 @@ func NoLoginArticle(stype, sid string) map[string]interface{} {
|
|
|
rData := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query":{"bool":{"should":[{"term":{"company_name":"%s"}},{"term":{"hname":"%s"}}],"minimum_should_match":1}},"_source":["name","_id","capital","company_phone"],"size":1}`, v, v))
|
|
|
if rData != nil && len(*rData) == 1 {
|
|
|
if entId := util.ObjToString((*rData)[0]["_id"]); entId != "" {
|
|
|
- entIdArr = append(entIdArr, util.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"])))
|
|
|
- winnerMap[v] = util.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
|
|
|
+ entIdArr = append(entIdArr, encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"])))
|
|
|
+ winnerMap[v] = encrypt.EncodeArticleId2ByCheck(util.ObjToString((*rData)[0]["_id"]))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -337,7 +310,7 @@ func NoLoginArticle(stype, sid string) map[string]interface{} {
|
|
|
if vstr == "-" {
|
|
|
continue
|
|
|
}
|
|
|
- winnerMap[swinnerArr[k]] = util.EncodeArticleId2ByCheck(vstr)
|
|
|
+ winnerMap[swinnerArr[k]] = encrypt.EncodeArticleId2ByCheck(vstr)
|
|
|
}
|
|
|
}
|
|
|
obj["entId"] = entIdArr
|
|
@@ -446,7 +419,7 @@ func CNode(userId string) bool {
|
|
|
delete(rM, "createtime")
|
|
|
delete(rM, "client")
|
|
|
}
|
|
|
- if userinfo := utils.Compatible.Select( userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
|
|
|
+ if userinfo := utils.Compatible.Select(userId, `{"s_phone":1,"s_m_phone":1,"s_myemail":1,"s_company":1,"o_jy":1,"o_vipjy":1}`); userinfo != nil && ok && len(*userinfo) > 0 {
|
|
|
s_phone := util.ObjToString((*userinfo)["s_phone"])
|
|
|
phone := util.If(s_phone == "", util.ObjToString((*userinfo)["s_m_phone"]), s_phone)
|
|
|
if rM["phone"] == nil || rM["phone"] == "" {
|
|
@@ -547,8 +520,8 @@ func getwinnertel(company interface{}) string {
|
|
|
|
|
|
func UserPermission(userId string) (isVip, isOldVip, isEntniche bool, i_member_status int, email string) {
|
|
|
var phone string
|
|
|
- data :=utils.Compatible.Select( userId, `{"i_vip_status":1,"i_member_status":1,"s_myemail":1,"s_phone":1,"s_m_phone":1,"l_vip_starttime":1}`)
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
+ data := utils.Compatible.Select(userId, `{"i_vip_status":1,"i_member_status":1,"s_myemail":1,"s_phone":1,"s_m_phone":1,"l_vip_starttime":1}`)
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
i_vip_status := util.IntAll((*data)["i_vip_status"])
|
|
|
if i_vip_status > 0 {
|
|
|
isVip = true
|