|
@@ -62,7 +62,6 @@ func (m *Follow) CheckFPStatus() error {
|
|
|
//
|
|
|
func (m *Follow) CheckCStatus() error {
|
|
|
defer util.Catch()
|
|
|
- //s_id := util.DecodeArticleId(m.GetString("s_id"))[0]
|
|
|
pname := m.GetString("pcname")
|
|
|
pcode := m.GetString("pccode")
|
|
|
userId, _ := m.GetSession("userId").(string)
|
|
@@ -71,11 +70,6 @@ func (m *Follow) CheckCStatus() error {
|
|
|
followid := ""
|
|
|
if userId != "" {
|
|
|
flag, followid = MFollow(userId, pname, pcode, "", openId)
|
|
|
- // follows, _ := mongodb.FindOneByField("follow_project", `{"s_id":"`+s_id+`","s_openid":"`+s_openid.(string)+`"}`, `{"_id":1}`)
|
|
|
- // if follows != nil && *follows != nil && len(*follows) > 0 {
|
|
|
- // flag = "t"
|
|
|
- // followid = strings.Split(fmt.Sprintf("%s", (*follows)["_id"]), `"`)[1]
|
|
|
- // }
|
|
|
}
|
|
|
m.ServeJson(map[string]interface{}{
|
|
|
"flag": flag,
|
|
@@ -134,11 +128,6 @@ func (m *Follow) Fwsave() {
|
|
|
data["i_source"] = 3
|
|
|
data["toptype"] = "招标"
|
|
|
fields := `"title","comeintime","bidopentime","projectcode","type","href","publishtime","area","subtype","toptype"`
|
|
|
- // res, ok := mongodb.FindById("bidding", s_id, fields)
|
|
|
- // if ok && (res == nil || *res == nil || len(*res) == 0) {
|
|
|
- // res, ok = mongodb.FindById("bidding_back", s_id, fields)
|
|
|
- // }
|
|
|
-
|
|
|
res := elastic.GetByIdField("bidding", "bidding", s_id, fields)
|
|
|
if res != nil {
|
|
|
projectcode, _ := (*res)["projectcode"].(string)
|
|
@@ -150,7 +139,6 @@ func (m *Follow) Fwsave() {
|
|
|
data["s_url"] = (*res)["href"]
|
|
|
data["s_province"] = (*res)["area"]
|
|
|
data["l_comeintime"] = (*res)["comeintime"]
|
|
|
- //data["l_lastpushtime"] = (*res)["comeintime"]
|
|
|
if data["l_bidopentime"] == "" {
|
|
|
data["l_bidopentime"] = (*res)["bidopentime"]
|
|
|
}
|
|
@@ -201,14 +189,8 @@ func (m *Follow) ShareFW(tp string) error {
|
|
|
projectcode := ""
|
|
|
m.T["projectname"] = projectname
|
|
|
m.T["projectcode"] = projectcode
|
|
|
- //userId, _ := m.GetSession("userId").(string)
|
|
|
m.T["fg"] = "F"
|
|
|
fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area"`
|
|
|
- // data, ok := mongodb.FindById("bidding", id, fields)
|
|
|
- // if ok && (data == nil || *data == nil || len(*data) == 0) {
|
|
|
- // data, _ = mongodb.FindById("bidding_back", id, fields)
|
|
|
- // }
|
|
|
-
|
|
|
data := elastic.GetByIdField("bidding", "bidding", id, fields)
|
|
|
bidopentime := (*data)["bidopentime"]
|
|
|
if bidopentime != nil {
|
|
@@ -291,8 +273,6 @@ func (m *Follow) PcEntAllNotice() error {
|
|
|
entname := m.GetString("entname")
|
|
|
data := map[string]interface{}{}
|
|
|
if entname != "" {
|
|
|
- //fields := `{"projectname":1,"bidamount":1,"title":1,"publishtime":1,"subtype":1,"toptype":1,"href":1}`
|
|
|
- //res, ok := tools.MQFW.Find("bidding", `{"winner":"`+entname+`"}`, `{"publishtime":-1}`, fields, false, -1, -1)
|
|
|
ok := true
|
|
|
fields := `"_id","projectname","bidamount","title","publishtime","subtype","toptype","href"`
|
|
|
res := elastic.GetPage("bidding", "bidding", `{"TERM_winner":"`+entname+`"}`, `{"publishtime":-1}`, fields, 0, 100)
|
|
@@ -312,80 +292,124 @@ func (m *Follow) PcEntAllNotice() error {
|
|
|
//未关注项目
|
|
|
func (m *Follow) Photo(tp string) error {
|
|
|
defer util.Catch()
|
|
|
+ followid := ""
|
|
|
tpm := strings.Split(tp, "__")
|
|
|
- id := util.DecodeArticleId2ByCheck(tpm[0])[0]
|
|
|
projectname := tpm[1]
|
|
|
projectcode := tpm[2]
|
|
|
- m.T["projectname"] = projectname
|
|
|
- m.T["projectcode"] = projectcode
|
|
|
userId, _ := m.GetSession("userId").(string)
|
|
|
openid := m.GetSession("s_m_openid").(string)
|
|
|
- if userId != "" {
|
|
|
- flag, followid := MFollow(userId, projectname, projectcode, "", openid)
|
|
|
- if flag && len(followid) > 0 {
|
|
|
- m.Redirect("/follow/set/list/" + followid)
|
|
|
- return nil
|
|
|
+ if userId != "" && openid != "" {
|
|
|
+ _, followid = MFollow(userId, projectname, projectcode, "", openid)
|
|
|
+ }
|
|
|
+ //已关注
|
|
|
+ if followid != "" {
|
|
|
+ id := util.DecodeArticleId2ByCheck(followid)[0]
|
|
|
+ fields := `{"s_id":1,"i_source":1,"s_projectname":1,"s_projectcode":1,"s_url":1,"i_remind":1,"s_type":1,"l_bidopentime":1,"l_remindtime":1,"a_relationinfo":1,"a_visited":1,"l_lastpushtime":1,"a_lastpushids":1}`
|
|
|
+ data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
|
|
|
+ "_id": bson.ObjectIdHex(id),
|
|
|
+ "s_openid": m.GetSession("s_m_openid").(string),
|
|
|
+ }, fields)
|
|
|
+ m.T["isDel"] = false
|
|
|
+ if ok && (data == nil || len(*data) == 0) {
|
|
|
+ data, ok = mongodb.FindOneByField("follow_project_back", `{"s_followid":"`+id+`"}`, fields)
|
|
|
+ m.T["isDel"] = true
|
|
|
}
|
|
|
- }
|
|
|
- m.T["fg"] = "F"
|
|
|
- fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area"`
|
|
|
- // data, ok := mongodb.FindById("bidding", id, fields)
|
|
|
- // if ok && (data == nil || *data == nil || len(*data) == 0) {
|
|
|
- // data, _ = mongodb.FindById("bidding_back", id, fields)
|
|
|
- // }
|
|
|
- data := elastic.GetByIdField("bidding", "bidding", id, fields)
|
|
|
- mySelf := make(bson.M)
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
- mySelf["s_projectname"] = projectname
|
|
|
- mySelf["s_title"] = (*data)["title"]
|
|
|
- mySelf["type"] = (*data)["type"]
|
|
|
- mySelf["subtype"] = (*data)["subtype"]
|
|
|
- mySelf["toptype"] = (*data)["toptype"]
|
|
|
- mySelf["area"] = (*data)["area"]
|
|
|
- mySelf["s_projectcode"] = projectcode
|
|
|
- mySelf["s_url"] = (*data)["href"]
|
|
|
- mySelf["s_id"] = id
|
|
|
- mySelf["s_eid"] = util.EncodeArticleId2ByCheck(id)
|
|
|
- mySelf["l_publishtime"] = (*data)["publishtime"]
|
|
|
- ////////////////////////
|
|
|
- bidopentime := (*data)["bidopentime"]
|
|
|
- if bidopentime != nil {
|
|
|
- m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
|
|
|
- m.T["l_bidopentime"] = bidopentime
|
|
|
+ if !ok || data == nil || len(*data) == 0 {
|
|
|
+ return m.Render("_error.html")
|
|
|
+ }
|
|
|
+ sid, _ := (*data)["s_id"].(string)
|
|
|
+ m.T["_id"] = followid
|
|
|
+ m.T["sid"] = util.EncodeArticleId2ByCheck(sid)
|
|
|
+ m.T["source"] = (*data)["i_source"]
|
|
|
+ m.T["projectname"] = (*data)["s_projectname"]
|
|
|
+ m.T["projectcode"] = (*data)["s_projectcode"]
|
|
|
+ m.T["url"] = (*data)["s_url"]
|
|
|
+ m.T["remind"] = (*data)["i_remind"]
|
|
|
+ m.T["type"] = (*data)["s_type"]
|
|
|
+ if sid != "" {
|
|
|
+ info := elastic.GetByIdField("bidding", "bidding", sid, `"type","subtype","toptype"`)
|
|
|
+ info_ok := info != nil && len(*info) != 0
|
|
|
+ if info_ok {
|
|
|
+ m.T["subtype"] = (*info)["subtype"]
|
|
|
+ m.T["toptype"] = (*info)["toptype"]
|
|
|
+ m.T["type"] = (*data)["type"]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ m.T["relationinfo"] = (*data)["a_relationinfo"]
|
|
|
+ m.T["a_visited"] = (*data)["a_visited"]
|
|
|
+ m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
|
|
|
+ m.T["a_lastpushids"] = (*data)["a_lastpushids"]
|
|
|
+ l_bidopentime := (*data)["l_bidopentime"]
|
|
|
+ if l_bidopentime != nil {
|
|
|
+ m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
|
|
|
+ m.T["l_bidopentime"] = l_bidopentime
|
|
|
}
|
|
|
- if remindtime := (*data)["remindtime"]; remindtime != nil {
|
|
|
- m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
|
|
|
- m.T["l_remindtime"] = remindtime
|
|
|
- } else if bidopentime != nil {
|
|
|
- date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
|
|
|
+ if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
|
|
|
+ m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
|
|
|
+ m.T["l_remindtime"] = l_remindtime
|
|
|
+ } else if l_bidopentime != nil {
|
|
|
+ date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
|
|
|
m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
|
|
|
m.T["l_remindtime"] = date.Unix()
|
|
|
}
|
|
|
- m.T["type"] = (*data)["type"]
|
|
|
- m.T["subtype"] = (*data)["subtype"]
|
|
|
- m.T["toptype"] = (*data)["toptype"]
|
|
|
- m.T["a_lastpushids"] = (*data)["a_lastpushids"]
|
|
|
- }
|
|
|
- if len(projectname) > 0 || len(projectcode) > 0 {
|
|
|
- res, _ := tools.FollowPush(&rpc.FollowPush{
|
|
|
- ProjectName: projectname,
|
|
|
- ProjectCode: projectcode,
|
|
|
- InfoId: id,
|
|
|
- FollowId: "",
|
|
|
- OpenId: m.GetSession("s_m_openid").(string),
|
|
|
- Flag: 1,
|
|
|
- })
|
|
|
- if len(res) > 0 || len(mySelf) > 0 {
|
|
|
- m.T["fg"] = "T"
|
|
|
- for _, v := range res {
|
|
|
- (*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
|
|
|
+ } else { //未关注
|
|
|
+ id := util.DecodeArticleId2ByCheck(tpm[0])[0]
|
|
|
+ m.T["projectname"] = projectname
|
|
|
+ m.T["projectcode"] = projectcode
|
|
|
+ fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area"`
|
|
|
+ data := elastic.GetByIdField("bidding", "bidding", id, fields)
|
|
|
+ mySelf := make(bson.M)
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
+ mySelf["s_projectname"] = projectname
|
|
|
+ mySelf["s_title"] = (*data)["title"]
|
|
|
+ mySelf["type"] = (*data)["type"]
|
|
|
+ mySelf["subtype"] = (*data)["subtype"]
|
|
|
+ mySelf["toptype"] = (*data)["toptype"]
|
|
|
+ mySelf["area"] = (*data)["area"]
|
|
|
+ mySelf["s_projectcode"] = projectcode
|
|
|
+ mySelf["s_url"] = (*data)["href"]
|
|
|
+ mySelf["s_id"] = id
|
|
|
+ mySelf["s_eid"] = util.EncodeArticleId2ByCheck(id)
|
|
|
+ mySelf["l_publishtime"] = (*data)["publishtime"]
|
|
|
+ ////////////////////////
|
|
|
+ bidopentime := (*data)["bidopentime"]
|
|
|
+ if bidopentime != nil {
|
|
|
+ m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
|
|
|
+ m.T["l_bidopentime"] = bidopentime
|
|
|
}
|
|
|
- m.T["data"] = res
|
|
|
- m.T["id"] = util.EncodeArticleId2ByCheck(id)
|
|
|
- m.T["mySelf"] = mySelf
|
|
|
+ if remindtime := (*data)["remindtime"]; remindtime != nil {
|
|
|
+ m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
|
|
|
+ m.T["l_remindtime"] = remindtime
|
|
|
+ } else if bidopentime != nil {
|
|
|
+ date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
|
|
|
+ m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
|
|
|
+ m.T["l_remindtime"] = date.Unix()
|
|
|
+ }
|
|
|
+ m.T["type"] = (*data)["type"]
|
|
|
+ m.T["subtype"] = (*data)["subtype"]
|
|
|
+ m.T["toptype"] = (*data)["toptype"]
|
|
|
+ m.T["a_lastpushids"] = (*data)["a_lastpushids"]
|
|
|
}
|
|
|
+ if len(projectname) > 0 || len(projectcode) > 0 {
|
|
|
+ res, _ := tools.FollowPush(&rpc.FollowPush{
|
|
|
+ ProjectName: projectname,
|
|
|
+ ProjectCode: projectcode,
|
|
|
+ InfoId: id,
|
|
|
+ FollowId: "",
|
|
|
+ OpenId: m.GetSession("s_m_openid").(string),
|
|
|
+ Flag: 1,
|
|
|
+ })
|
|
|
+ if len(res) > 0 || len(mySelf) > 0 {
|
|
|
+ for _, v := range res {
|
|
|
+ (*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
|
|
|
+ }
|
|
|
+ m.T["data"] = res
|
|
|
+ m.T["id"] = util.EncodeArticleId2ByCheck(id)
|
|
|
+ m.T["mySelf"] = mySelf
|
|
|
+ }
|
|
|
+ }
|
|
|
+ m.T["source"] = 1
|
|
|
}
|
|
|
- m.T["source"] = 1
|
|
|
myopenid, _ := m.Session().Get("s_m_openid").(string)
|
|
|
m.T["openid"] = se.EncodeString(myopenid)
|
|
|
mynickname, _ := m.Session().Get("s_nickname").(string)
|
|
@@ -578,14 +602,6 @@ func (m *Follow) Addsave() error {
|
|
|
}
|
|
|
//匹配
|
|
|
r := elastic.GetPage("bidding", "bidding", `{"TERM_projectname":"`+projectname+`"}`, `{"comeintime":-1}`, `"_id","title","comeintime","bidopentime","projectcode","type","href","publishtime","subtype","toptype","area"`, -1, -1)
|
|
|
- // r, ok := mongodb.Find("bidding", bson.M{
|
|
|
- // "projectname": projectname,
|
|
|
- // }, `{"comeintime":-1}`, `{"title":1,"comeintime":1,"bidopentime":1,"projectcode":1,"type":1,"href":1,"publishtime":1,"subtype":1,"toptype":1,"area":1}`, false, 0, -1)
|
|
|
- // if r == nil || *r == nil || len(*r) == 0 {
|
|
|
- // r, _ = mongodb.Find("bidding_back", bson.M{
|
|
|
- // "projectname": projectname,
|
|
|
- // }, `{"comeintime":-1}`, `{"title":1,"comeintime":1,"bidopentime":1,"projectcode":1,"type":1,"href":1,"publishtime":1,"subtype":1,"toptype":1,"area":1}`, false, 0, -1)
|
|
|
- // }
|
|
|
var matchingFlag = r != nil && len(*r) != 0
|
|
|
var projectcode, sid string
|
|
|
if matchingFlag {
|
|
@@ -645,64 +661,112 @@ func (m *Follow) Addsave() error {
|
|
|
}
|
|
|
func (m *Follow) Set(tp, id string) error {
|
|
|
defer util.Catch()
|
|
|
+ isDel := false
|
|
|
id = util.DecodeArticleId2ByCheck(id)[0]
|
|
|
fields := `{"s_id":1,"i_source":1,"s_projectname":1,"s_projectcode":1,"s_url":1,"i_remind":1,"s_type":1,"l_bidopentime":1,"l_remindtime":1,"a_relationinfo":1,"a_visited":1,"l_lastpushtime":1,"a_lastpushids":1}`
|
|
|
data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
|
|
|
"_id": bson.ObjectIdHex(id),
|
|
|
"s_openid": m.GetSession("s_m_openid").(string),
|
|
|
}, fields)
|
|
|
- m.T["isDel"] = false
|
|
|
if ok && (data == nil || len(*data) == 0) {
|
|
|
data, ok = mongodb.FindOneByField("follow_project_back", `{"s_followid":"`+id+`"}`, fields)
|
|
|
- m.T["isDel"] = true
|
|
|
+ isDel = true
|
|
|
}
|
|
|
if !ok || data == nil || len(*data) == 0 {
|
|
|
return m.Render("_error.html")
|
|
|
}
|
|
|
sid, _ := (*data)["s_id"].(string)
|
|
|
- m.T["_id"] = util.EncodeArticleId2ByCheck(id)
|
|
|
- m.T["sid"] = util.EncodeArticleId2ByCheck(sid)
|
|
|
- m.T["source"] = (*data)["i_source"]
|
|
|
- m.T["projectname"] = (*data)["s_projectname"]
|
|
|
- m.T["projectcode"] = (*data)["s_projectcode"]
|
|
|
- m.T["url"] = (*data)["s_url"]
|
|
|
- m.T["remind"] = (*data)["i_remind"]
|
|
|
- m.T["type"] = (*data)["s_type"]
|
|
|
- if sid != "" {
|
|
|
- info := elastic.GetByIdField("bidding", "bidding", sid, `"type","subtype","toptype"`)
|
|
|
- info_ok := info != nil && len(*info) != 0
|
|
|
- // info, info_ok := mongodb.FindOneByField("bidding", map[string]interface{}{
|
|
|
- // "_id": bson.ObjectIdHex(sid),
|
|
|
- // }, `{"type":1,"subtype":1,"toptype":1}`)
|
|
|
- // if info_ok && (info == nil || *info == nil || len(*info) == 0) {
|
|
|
- // info, info_ok = mongodb.FindOneByField("bidding_back", map[string]interface{}{
|
|
|
- // "_id": bson.ObjectIdHex(sid),
|
|
|
- // }, `{"type":1,"subtype":1,"toptype":1}`)
|
|
|
- // }
|
|
|
- if info_ok {
|
|
|
- m.T["subtype"] = (*info)["subtype"]
|
|
|
- m.T["toptype"] = (*info)["toptype"]
|
|
|
+ projectname, _ := (*data)["s_projectname"].(string)
|
|
|
+ projectcode, _ := (*data)["s_projectcode"].(string)
|
|
|
+ if isDel {
|
|
|
+ fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area"`
|
|
|
+ data := elastic.GetByIdField("bidding", "bidding", sid, fields)
|
|
|
+ mySelf := make(bson.M)
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
+ mySelf["s_projectname"] = projectname
|
|
|
+ mySelf["s_title"] = (*data)["title"]
|
|
|
+ mySelf["type"] = (*data)["type"]
|
|
|
+ mySelf["subtype"] = (*data)["subtype"]
|
|
|
+ mySelf["toptype"] = (*data)["toptype"]
|
|
|
+ mySelf["area"] = (*data)["area"]
|
|
|
+ mySelf["s_projectcode"] = projectcode
|
|
|
+ mySelf["s_url"] = (*data)["href"]
|
|
|
+ mySelf["s_id"] = sid
|
|
|
+ mySelf["s_eid"] = util.EncodeArticleId2ByCheck(sid)
|
|
|
+ mySelf["l_publishtime"] = (*data)["publishtime"]
|
|
|
+ ////////////////////////
|
|
|
+ bidopentime := (*data)["bidopentime"]
|
|
|
+ if bidopentime != nil {
|
|
|
+ m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
|
|
|
+ m.T["l_bidopentime"] = bidopentime
|
|
|
+ }
|
|
|
+ if remindtime := (*data)["remindtime"]; remindtime != nil {
|
|
|
+ m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
|
|
|
+ m.T["l_remindtime"] = remindtime
|
|
|
+ } else if bidopentime != nil {
|
|
|
+ date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
|
|
|
+ m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
|
|
|
+ m.T["l_remindtime"] = date.Unix()
|
|
|
+ }
|
|
|
m.T["type"] = (*data)["type"]
|
|
|
+ m.T["subtype"] = (*data)["subtype"]
|
|
|
+ m.T["toptype"] = (*data)["toptype"]
|
|
|
+ m.T["a_lastpushids"] = (*data)["a_lastpushids"]
|
|
|
+ }
|
|
|
+ if len(projectname) > 0 || len(projectcode) > 0 {
|
|
|
+ res, _ := tools.FollowPush(&rpc.FollowPush{
|
|
|
+ ProjectName: projectname,
|
|
|
+ ProjectCode: projectcode,
|
|
|
+ InfoId: sid,
|
|
|
+ FollowId: "",
|
|
|
+ OpenId: m.GetSession("s_m_openid").(string),
|
|
|
+ Flag: 1,
|
|
|
+ })
|
|
|
+ if len(res) > 0 || len(mySelf) > 0 {
|
|
|
+ for _, v := range res {
|
|
|
+ (*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
|
|
|
+ }
|
|
|
+ m.T["data"] = res
|
|
|
+ m.T["id"] = util.EncodeArticleId2ByCheck(sid)
|
|
|
+ m.T["mySelf"] = mySelf
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ m.T["_id"] = util.EncodeArticleId2ByCheck(id)
|
|
|
+ m.T["sid"] = util.EncodeArticleId2ByCheck(sid)
|
|
|
+ m.T["source"] = (*data)["i_source"]
|
|
|
+ m.T["url"] = (*data)["s_url"]
|
|
|
+ m.T["remind"] = (*data)["i_remind"]
|
|
|
+ m.T["type"] = (*data)["s_type"]
|
|
|
+ if sid != "" {
|
|
|
+ info := elastic.GetByIdField("bidding", "bidding", sid, `"type","subtype","toptype"`)
|
|
|
+ info_ok := info != nil && len(*info) != 0
|
|
|
+ if info_ok {
|
|
|
+ m.T["subtype"] = (*info)["subtype"]
|
|
|
+ m.T["toptype"] = (*info)["toptype"]
|
|
|
+ m.T["type"] = (*data)["type"]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ m.T["relationinfo"] = (*data)["a_relationinfo"]
|
|
|
+ m.T["a_visited"] = (*data)["a_visited"]
|
|
|
+ m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
|
|
|
+ m.T["a_lastpushids"] = (*data)["a_lastpushids"]
|
|
|
+ l_bidopentime := (*data)["l_bidopentime"]
|
|
|
+ if l_bidopentime != nil {
|
|
|
+ m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
|
|
|
+ m.T["l_bidopentime"] = l_bidopentime
|
|
|
+ }
|
|
|
+ if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
|
|
|
+ m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
|
|
|
+ m.T["l_remindtime"] = l_remindtime
|
|
|
+ } else if l_bidopentime != nil {
|
|
|
+ date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
|
|
|
+ m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
|
|
|
+ m.T["l_remindtime"] = date.Unix()
|
|
|
}
|
|
|
}
|
|
|
- m.T["relationinfo"] = (*data)["a_relationinfo"]
|
|
|
- m.T["a_visited"] = (*data)["a_visited"]
|
|
|
- m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
|
|
|
- m.T["a_lastpushids"] = (*data)["a_lastpushids"]
|
|
|
- l_bidopentime := (*data)["l_bidopentime"]
|
|
|
- if l_bidopentime != nil {
|
|
|
- m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
|
|
|
- m.T["l_bidopentime"] = l_bidopentime
|
|
|
- }
|
|
|
- if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
|
|
|
- m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
|
|
|
- m.T["l_remindtime"] = l_remindtime
|
|
|
- } else if l_bidopentime != nil {
|
|
|
- date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
|
|
|
- m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
|
|
|
- m.T["l_remindtime"] = date.Unix()
|
|
|
- }
|
|
|
- m.T["flag"] = true
|
|
|
+ m.T["projectname"] = projectname
|
|
|
+ m.T["projectcode"] = projectcode
|
|
|
myopenid, _ := m.Session().Get("s_m_openid").(string)
|
|
|
m.T["openid"] = se.EncodeString(myopenid)
|
|
|
mynickname, _ := m.Session().Get("s_nickname").(string)
|