|
@@ -4,6 +4,7 @@ import (
|
|
|
"mongodb"
|
|
|
qu "qfw/util"
|
|
|
"qfw/util/mysql"
|
|
|
+ "strings"
|
|
|
)
|
|
|
|
|
|
//是否是付费用户
|
|
@@ -57,39 +58,44 @@ func (vs *VipState) IsPayedUser() bool {
|
|
|
//付费用户 全部(all)、标题(title) 正文(content) 会员: 采购单位(buyer) 中标企业(winner) 招标代理机构(agency) 附件(file)
|
|
|
func (vs *VipState) GetQueryItems(selectType string, limitOldTime int64) (items []string) {
|
|
|
if vs.IsPayedUser() {
|
|
|
- switch selectType {
|
|
|
- case "content":
|
|
|
- items = append(items, "detail")
|
|
|
- break
|
|
|
- case "buyer":
|
|
|
- items = append(items, "mbuyer")
|
|
|
- break
|
|
|
- case "winner":
|
|
|
- items = append(items, "mwinner")
|
|
|
- break
|
|
|
- case "agency":
|
|
|
- items = append(items, "magency")
|
|
|
- break
|
|
|
- case "file":
|
|
|
- items = append(items, "filetext")
|
|
|
- break
|
|
|
- case "all":
|
|
|
+ if selectType == "all" {
|
|
|
items = append(items, "title", "detail", "mbuyer", "mwinner", "magency", "filetext")
|
|
|
- break
|
|
|
+ } else {
|
|
|
+ for _, t := range strings.Split(selectType, ",") {
|
|
|
+ if t == "content" {
|
|
|
+ items = append(items, "detail")
|
|
|
+ } else if t == "buyer" {
|
|
|
+ items = append(items, "mbuyer")
|
|
|
+ } else if t == "winner" {
|
|
|
+ items = append(items, "mwinner")
|
|
|
+ } else if t == "agency" {
|
|
|
+ items = append(items, "magency")
|
|
|
+ } else if t == "file" {
|
|
|
+ items = append(items, "filetext")
|
|
|
+ } else if t == "title" {
|
|
|
+ items = append(items, "title")
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
- if selectType == "winner" || selectType == "all" {
|
|
|
- isOldUser := vs.registerData < limitOldTime
|
|
|
- if selectType == "all" {
|
|
|
- if isOldUser {
|
|
|
- items = append(items, "title", "detail", "mwinner")
|
|
|
+ isOldUser := vs.registerData != 0 && vs.registerData < limitOldTime
|
|
|
+ if selectType == "all" {
|
|
|
+ if isOldUser {
|
|
|
+ items = append(items, "title", "detail", "mwinner")
|
|
|
+ }
|
|
|
+ } else { //查询中标企业且是老用户
|
|
|
+ for _, t := range strings.Split(selectType, ",") {
|
|
|
+ if t == "winner" {
|
|
|
+ if isOldUser {
|
|
|
+ items = append(items, "mwinner")
|
|
|
+ }
|
|
|
+ } else if t == "title" {
|
|
|
+ items = append(items, "title")
|
|
|
+ } else if t == "content" {
|
|
|
+ items = append(items, "detail")
|
|
|
}
|
|
|
- } else if isOldUser { //查询中标企业且是老用户
|
|
|
- items = append(items, "mwinner")
|
|
|
}
|
|
|
- } else if selectType == "content" {
|
|
|
- items = append(items, "detail")
|
|
|
}
|
|
|
return
|
|
|
}
|