|
@@ -36,12 +36,13 @@ type Short struct {
|
|
|
var mobileReg = regexp.MustCompile("(?i)(Android|Mobile|Phone)")
|
|
|
var DateFullLayout = "2006-01-02 15:04:05"
|
|
|
var Map_stype = map[string]bool{
|
|
|
- "content": true,
|
|
|
- "entservice": true,
|
|
|
- "bdprivate": true,
|
|
|
- "mailprivate": true,
|
|
|
- "bdcontent": true,
|
|
|
- "indexcontent": true,
|
|
|
+ "content": true,
|
|
|
+ "entservice": true,
|
|
|
+ "bdprivate": true,
|
|
|
+ "mailprivate": true,
|
|
|
+ "bdcontent": true,
|
|
|
+ "indexcontent": true,
|
|
|
+ "advancedProject": true,
|
|
|
}
|
|
|
|
|
|
func (s *Short) Article(stype, id string) error {
|
|
@@ -75,7 +76,7 @@ func (s *Short) Article(stype, id string) error {
|
|
|
if !Map_stype[stype] {
|
|
|
s.Redirect("/not/nottype", 302)
|
|
|
return nil
|
|
|
- } else if stype == "content" || stype == "bdcontent" {
|
|
|
+ } else if stype == "content" || stype == "bdcontent" || stype == "advancedProject" {
|
|
|
if s.Session().Get("userId") == nil {
|
|
|
if s.GetString("state") == "wx" {
|
|
|
//微信跳回来的
|
|
@@ -145,7 +146,6 @@ func (s *Short) Article(stype, id string) error {
|
|
|
s.T["shareid"] = se.EncodeString(shareid)
|
|
|
s.T["keywords"] = s.GetString("kds")
|
|
|
ssOpenid := s.Session().Get("s_m_openid")
|
|
|
-
|
|
|
po, bo, wo, obj := pcVRT(sid, industry, stype, true)
|
|
|
if obj != nil && len(obj) > 0 {
|
|
|
|
|
@@ -222,7 +222,6 @@ func (s *Short) Article(stype, id string) error {
|
|
|
if ok && res != nil && len(*res) > 0 {
|
|
|
isVip = util.IntAll((*res)["i_vip_status"]) == 1 || util.IntAll((*res)["i_vip_status"]) == 2
|
|
|
isMember = util.IntAll((*res)["i_member_status"]) > 0
|
|
|
-
|
|
|
if isVip && util.Int64All((*res)["l_vip_starttime"]) < util.Int64All(config.Sysconfig["contextOldVipLimit"]) {
|
|
|
isOldVip = true
|
|
|
}
|
|
@@ -293,6 +292,24 @@ func (s *Short) Article(stype, id string) error {
|
|
|
} else {
|
|
|
canRead = SeeDetailLimit(obj, userId, sid)
|
|
|
}
|
|
|
+ if stype == "advancedProject" {
|
|
|
+ newCanRead := false
|
|
|
+ //判断此用户是否有打开的权限
|
|
|
+ newUserId := s.GetSession("base_user_id")
|
|
|
+ pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
|
|
|
+ //访问次数加1
|
|
|
+ if pushData == nil {
|
|
|
+ newCanRead = false
|
|
|
+ } else {
|
|
|
+ public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
|
|
|
+ newCanRead = true
|
|
|
+ }
|
|
|
+ if newCanRead || canRead {
|
|
|
+ obj = wxvisitD(sid, userId, myopenid, stype, true)
|
|
|
+ canRead = true
|
|
|
+ }
|
|
|
+ s.T["canRead"] = canRead
|
|
|
+ }
|
|
|
if len(obj) > 0 {
|
|
|
if canRead {
|
|
|
FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, true)
|
|
@@ -370,7 +387,6 @@ func (s *Short) Article(stype, id string) error {
|
|
|
return nil
|
|
|
}
|
|
|
sid := sids[0]
|
|
|
-
|
|
|
//免费用户浏览三级页判断留资与浏览次数
|
|
|
indust := s.GetString("industry")
|
|
|
if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
|
|
@@ -397,6 +413,25 @@ func (s *Short) Article(stype, id string) error {
|
|
|
node = SeeDetailLimit(objc, userId, sid)
|
|
|
}
|
|
|
s.T["canRead"] = node
|
|
|
+ if stype == "advancedProject" {
|
|
|
+ canRead := false
|
|
|
+ //判断此用户是否有打开的权限
|
|
|
+ newUserId := s.GetSession("base_user_id")
|
|
|
+ pushData := public.BaseMysql.FindOne("leadproject_push", map[string]interface{}{"user_id": newUserId, "info_id": sid}, "id", "")
|
|
|
+ //访问次数加1
|
|
|
+ if pushData == nil {
|
|
|
+ canRead = false
|
|
|
+ } else {
|
|
|
+ public.BaseMysql.UpdateOrDeleteBySql("UPDATE leadproject_push SET visit_count=visit_count+1 ,lastvisit_time=? WHERE id = ?", time.Now().Format("2006-01-02 15:04:05"), (*pushData)["id"])
|
|
|
+ canRead = true
|
|
|
+ }
|
|
|
+ if canRead || node {
|
|
|
+ _, _, _, obj = pcVRT(sid, indust, stype, true)
|
|
|
+ canRead = true
|
|
|
+ node = canRead
|
|
|
+ }
|
|
|
+ s.T["canRead"] = canRead
|
|
|
+ }
|
|
|
if node {
|
|
|
if len(po) > 0 {
|
|
|
s.T["projectOther"] = po
|
|
@@ -476,7 +511,6 @@ func (s *Short) Article(stype, id string) error {
|
|
|
|
|
|
s.T["obj"] = obj
|
|
|
s.T["url"] = s.Uri()
|
|
|
-
|
|
|
return s.Render("/pc/biddetail_rec.html", &s.T)
|
|
|
|
|
|
}
|