|
@@ -70,7 +70,7 @@ func (u *Use) SubPageMoveTip() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-//首次使用加入大会员
|
|
|
+// 首次使用加入大会员
|
|
|
func (u *Use) Add() {
|
|
|
r := func() Result {
|
|
|
userid := qu.ObjToString(u.GetSession("userId"))
|
|
@@ -201,7 +201,7 @@ func (u *Use) Add() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//用户大会员信息
|
|
|
+// 用户大会员信息
|
|
|
func (u *Use) Info() {
|
|
|
r := func() Result {
|
|
|
userid := qu.ObjToString(u.GetSession("userId"))
|
|
@@ -265,7 +265,7 @@ func (u *Use) Info() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//初始化信息
|
|
|
+// 初始化信息
|
|
|
func (u *Use) Echo() {
|
|
|
if !R.CheckReqParam(u.ResponseWriter, u.Request, "entname") {
|
|
|
return
|
|
@@ -338,7 +338,7 @@ func (u *Use) Echo() {
|
|
|
"size": 0
|
|
|
}
|
|
|
`
|
|
|
- res, _ := util.GetAggs(db.DbConf.Elascit_index, db.DbConf.Elascit_type, fmt.Sprintf(query, name))
|
|
|
+ res := util.GetAggs(db.DbConf.Elascit_index, db.DbConf.Elascit_type, fmt.Sprintf(query, name))
|
|
|
echo_map["area"] = GetData(res, "group_area") //地区
|
|
|
echo_map["buyer"] = GetData(res, "group_buyer") //采购单位集合
|
|
|
industrys := GetData(res, "group_topscopeclass") //industry行业
|
|
@@ -423,7 +423,7 @@ func (u *Use) Echo() {
|
|
|
by := `"` + strings.Replace(buyer, `,`, `","`, -1) + `"`
|
|
|
industry := StringArrToString(industrys)
|
|
|
is := `"` + strings.Replace(industry, `,`, `","`, -1) + `"`
|
|
|
- res2, _ := util.GetAggs(db.DbConf.Elascit_index, db.DbConf.Elascit_type, fmt.Sprintf(query2, by, is))
|
|
|
+ res2 := util.GetAggs(db.DbConf.Elascit_index, db.DbConf.Elascit_type, fmt.Sprintf(query2, by, is))
|
|
|
winners, ids := []string{}, []string{}
|
|
|
if winners := GetData(res2, "g_winner"); len(winners) > 0 {
|
|
|
winners, ids = gitWinnersIds(winners)
|
|
@@ -435,7 +435,7 @@ func (u *Use) Echo() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//附件下载
|
|
|
+// 附件下载
|
|
|
func (u *Use) Attachment() {
|
|
|
if !R.CheckReqParam(u.ResponseWriter, u.Request, "infoId") {
|
|
|
return
|
|
@@ -477,7 +477,7 @@ func (u *Use) Attachment() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//邮件附件下载 ios
|
|
|
+// 邮件附件下载 ios
|
|
|
func (u *Use) Email_attachement() {
|
|
|
if !R.CheckReqParam(u.ResponseWriter, u.Request, "email", "downurl") {
|
|
|
return
|
|
@@ -492,7 +492,7 @@ func (u *Use) Email_attachement() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//会员权益
|
|
|
+// 会员权益
|
|
|
func (u *Use) Equity() {
|
|
|
r := func() Result {
|
|
|
userid := qu.ObjToString(u.GetSession("userId"))
|
|
@@ -573,7 +573,7 @@ func (u *Use) Equity() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//大会员权益修改
|
|
|
+// 大会员权益修改
|
|
|
func (u *Use) Update() {
|
|
|
r := func() Result {
|
|
|
userid := qu.ObjToString(u.GetSession("userId"))
|
|
@@ -665,7 +665,7 @@ type UserInfo struct {
|
|
|
VipBefore202209 bool `json:"vipBefore202209"` //超级订阅:超前项目权限
|
|
|
}
|
|
|
|
|
|
-//是否使用过首次使用
|
|
|
+// 是否使用过首次使用
|
|
|
func (u *Use) IsAdd() {
|
|
|
r := func() Result {
|
|
|
uRefer := u.Refer()
|
|
@@ -758,7 +758,6 @@ func (u *Use) IsAdd() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func initEntSess(phone string) int {
|
|
|
list := db.Mysql.SelectBySql(`select a.id,a.isNew,a.name,b.id as user_id from entniche_info a
|
|
|
inner join entniche_user b on (a.status=1 and b.phone=? and b.power=1 and a.id=b.ent_id)
|
|
@@ -770,7 +769,6 @@ func initEntSess(phone string) int {
|
|
|
return 0
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func intStringsJoin(is []int) string {
|
|
|
var str = []string{}
|
|
|
for _, v := range is {
|
|
@@ -779,7 +777,7 @@ func intStringsJoin(is []int) string {
|
|
|
return strings.Join(str, ",")
|
|
|
}
|
|
|
|
|
|
-//AI中标预测历史记录
|
|
|
+// AI中标预测历史记录
|
|
|
func (u *Use) Aiused_history() {
|
|
|
r := func() Result {
|
|
|
userid := qu.ObjToString(u.GetSession("userId"))
|
|
@@ -831,7 +829,7 @@ func (u *Use) Aiused_history() {
|
|
|
u.ServeJson(r)
|
|
|
}
|
|
|
|
|
|
-//获取当前登录用户的手机号
|
|
|
+// 获取当前登录用户的手机号
|
|
|
func Phone(userId string) (string, string) {
|
|
|
u, ok := db.Mgo.FindById("user", userId, `{"s_phone":1,"s_m_phone":1}`)
|
|
|
if ok && u != nil {
|
|
@@ -844,7 +842,7 @@ func Phone(userId string) (string, string) {
|
|
|
return "", ""
|
|
|
}
|
|
|
|
|
|
-//获取聚合遍历结果
|
|
|
+// 获取聚合遍历结果
|
|
|
func GetData(res esV7.Aggregations, field string) []string {
|
|
|
arr := []string{}
|
|
|
if g, ok := res.Children(field); ok {
|
|
@@ -862,7 +860,7 @@ func GetData(res esV7.Aggregations, field string) []string {
|
|
|
return arr
|
|
|
}
|
|
|
|
|
|
-//数组转string
|
|
|
+// 数组转string
|
|
|
func StringArrToString(arr []string) string {
|
|
|
s := ""
|
|
|
if len(arr) <= 0 {
|
|
@@ -878,7 +876,7 @@ func StringArrToString(arr []string) string {
|
|
|
return s
|
|
|
}
|
|
|
|
|
|
-//合并
|
|
|
+// 合并
|
|
|
func Merge(echo_map map[string]interface{}, userid string, session *httpsession.Session) map[string]interface{} {
|
|
|
m := map[string]interface{}{}
|
|
|
for _, v := range echo_map["area"].([]string) {
|
|
@@ -947,12 +945,12 @@ func Merge(echo_map map[string]interface{}, userid string, session *httpsession.
|
|
|
return echo_map
|
|
|
}
|
|
|
|
|
|
-//合并数组并去重
|
|
|
+// 合并数组并去重
|
|
|
func MergeArr(arr1, arr2 []string) []string {
|
|
|
return DeleteRepeat(append(arr1, arr2...))
|
|
|
}
|
|
|
|
|
|
-//去重
|
|
|
+// 去重
|
|
|
func DeleteRepeat(slice []string) []string {
|
|
|
m := make(map[string]int)
|
|
|
slice_repeat := []string{}
|
|
@@ -974,7 +972,7 @@ func DeleteRepeat(slice []string) []string {
|
|
|
---> { key:["关1"] },{ key:["关2"] },{ key:["附1"] }
|
|
|
*/
|
|
|
|
|
|
-//合并关键词(超级订阅关键词)
|
|
|
+// 合并关键词(超级订阅关键词)
|
|
|
func MergeKeyWords(kw []map[string]interface{}) []map[string]interface{} {
|
|
|
keywords := []map[string]interface{}{}
|
|
|
a_key := []map[string]interface{}{}
|
|
@@ -1023,7 +1021,7 @@ func MergeKeyWords(kw []map[string]interface{}) []map[string]interface{} {
|
|
|
return keywords
|
|
|
}
|
|
|
|
|
|
-//子账号列表
|
|
|
+// 子账号列表
|
|
|
func SubAccout(userid string) []string {
|
|
|
account := []string{}
|
|
|
res, ok := db.Mgo.Find("user", map[string]interface{}{
|
|
@@ -1041,7 +1039,7 @@ func SubAccout(userid string) []string {
|
|
|
return account
|
|
|
}
|
|
|
|
|
|
-//获取AI中标预测次数 (return 剩余次数 已使用次数)
|
|
|
+// 获取AI中标预测次数 (return 剩余次数 已使用次数)
|
|
|
func GetSurplusCount(userid string) (int, int) {
|
|
|
//大会员用户服务详情表
|
|
|
data := db.Mysql.SelectBySql(`SELECT a.s_serviceid, a.i_frequency FROM `+jy.BigmemberUserPowerTable+` a WHERE a.s_userid = ? AND a.i_status = 0 AND a.s_serviceid in (6,15)`, userid)
|
|
@@ -1059,7 +1057,6 @@ func GetSurplusCount(userid string) (int, int) {
|
|
|
return forecastCount, bidfileCount
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func addOldent(userid, entname string) {
|
|
|
if db.Mgo.Count("jylab_followent", map[string]interface{}{"s_userid": userid, "s_entname": entname}) > 0 {
|
|
|
return
|
|
@@ -1075,7 +1072,6 @@ func addOldent(userid, entname string) {
|
|
|
db.Mgo.Save("jylab_followent", data)
|
|
|
}
|
|
|
|
|
|
-//
|
|
|
func Combo(userid string, member_status int) (combo_name string) {
|
|
|
data := db.Mysql.SelectBySql(`SELECT filter FROM dataexport_order WHERE filter LIKE '%"comboId"%'
|
|
|
AND user_id =? AND filter NOT LIKE '%"comboId":0%'
|
|
@@ -1110,7 +1106,7 @@ func Combo(userid string, member_status int) (combo_name string) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//根据企业名称获取企业id
|
|
|
+// 根据企业名称获取企业id
|
|
|
func gitWinnersIds(winners []string) (names []string, ids []string) {
|
|
|
names, ids = []string{}, []string{}
|
|
|
queryName := `"` + strings.Join(winners, `","`) + `"`
|
|
@@ -1125,7 +1121,7 @@ func gitWinnersIds(winners []string) (names []string, ids []string) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//合并大会员关键词
|
|
|
+// 合并大会员关键词
|
|
|
func MergeMemberKw(old, new []map[string]interface{}) []map[string]interface{} {
|
|
|
//判断是否有相同的分类名称
|
|
|
sameBl, index := false, -1
|