Parcourir la source

pref:主程序及app 删除无用函数、打印及逻辑

wangkaiyue il y a 3 ans
Parent
commit
3bf4e8f849
77 fichiers modifiés avec 1275 ajouts et 2699 suppressions
  1. 0 3
      .vscode/settings.json
  2. 0 10
      1.html
  3. 0 17
      extend/main.go
  4. 2 2
      src/jfw/active/active.go
  5. 2 10
      src/jfw/active/active_future.go
  6. 3 10
      src/jfw/active/active_seal.go
  7. 0 20
      src/jfw/active/zqluckdraw_test.go
  8. 2 3
      src/jfw/config/config.go
  9. 0 6
      src/jfw/course/course.go
  10. 0 3
      src/jfw/course/course_wx.go
  11. 2 2
      src/jfw/front/adv.go
  12. 2 60
      src/jfw/front/applysub.go
  13. 1 1
      src/jfw/front/big-member.go
  14. 10 16
      src/jfw/front/commonPayWx.go
  15. 2 295
      src/jfw/front/dataExport.go
  16. 0 99
      src/jfw/front/dealinfo.go
  17. 0 8
      src/jfw/front/distribution.go
  18. 0 1
      src/jfw/front/entsearch.go
  19. 1051 1062
      src/jfw/front/follow.go
  20. 40 103
      src/jfw/front/front.go
  21. 0 1
      src/jfw/front/frontRouter.go
  22. 0 2
      src/jfw/front/jyshare.go
  23. 8 8
      src/jfw/front/login.go
  24. 0 14
      src/jfw/front/pcIndex.go
  25. 2 33
      src/jfw/front/pchelper.go
  26. 0 4
      src/jfw/front/search.go
  27. 1 1
      src/jfw/front/shorturl.go
  28. 0 2
      src/jfw/front/supsearch.go
  29. 0 6
      src/jfw/front/swordfish.go
  30. 0 2
      src/jfw/front/uploadfile.go
  31. 0 2
      src/jfw/front/vipsubscribe.go
  32. 3 28
      src/jfw/front/ws_dataExport.go
  33. 3 13
      src/jfw/front/wxMyOrder.go
  34. 3 17
      src/jfw/front/wx_dataExport.go
  35. 0 6
      src/jfw/front/wxkeyset.go
  36. 1 1
      src/jfw/jylabutil/authority.go
  37. 1 1
      src/jfw/jylabutil/entsearch.go
  38. 1 102
      src/jfw/jyutil/jyutil.go
  39. 0 11
      src/jfw/jyutil/rsa_test.go
  40. 0 7
      src/jfw/jyutil/sessionEncryption.go
  41. 5 7
      src/jfw/jyutil/sessionkeep.go
  42. 0 10
      src/jfw/jyutil/sort.go
  43. 2 3
      src/jfw/modules/app/src/app/active/active.go
  44. 0 4
      src/jfw/modules/app/src/app/active/pullnew/pullnew.go
  45. 0 12
      src/jfw/modules/app/src/app/followent/followent.go
  46. 1 2
      src/jfw/modules/app/src/app/front/bigMember.go
  47. 13 13
      src/jfw/modules/app/src/app/front/commonPay.go
  48. 10 19
      src/jfw/modules/app/src/app/front/course.go
  49. 17 29
      src/jfw/modules/app/src/app/front/dataExport.go
  50. 0 1
      src/jfw/modules/app/src/app/front/dataPackRouter.go
  51. 2 4
      src/jfw/modules/app/src/app/front/distrib.go
  52. 6 6
      src/jfw/modules/app/src/app/front/entniche.go
  53. 1 2
      src/jfw/modules/app/src/app/front/errLogsReceive.go
  54. 4 7
      src/jfw/modules/app/src/app/front/follow.go
  55. 2 15
      src/jfw/modules/app/src/app/front/front.go
  56. 0 2
      src/jfw/modules/app/src/app/front/laboratory.go
  57. 16 56
      src/jfw/modules/app/src/app/front/login.go
  58. 11 18
      src/jfw/modules/app/src/app/front/logoffuser.go
  59. 5 8
      src/jfw/modules/app/src/app/front/me.go
  60. 2 11
      src/jfw/modules/app/src/app/front/myorder.go
  61. 2 9
      src/jfw/modules/app/src/app/front/shorturl.go
  62. 6 6
      src/jfw/modules/app/src/app/front/structedData.go
  63. 0 41
      src/jfw/modules/app/src/app/front/swordfish.go
  64. 3 5
      src/jfw/modules/app/src/app/front/tencentcloud.go
  65. 2 3
      src/jfw/modules/app/src/app/front/uploadfile.go
  66. 5 15
      src/jfw/modules/app/src/app/front/ws_dataExport.go
  67. 2 6
      src/jfw/modules/app/src/app/front/wxkeyset.go
  68. 8 23
      src/jfw/modules/app/src/app/jylabutil/authority.go
  69. 4 73
      src/jfw/modules/app/src/app/jylabutil/entsearch.go
  70. 0 1
      src/jfw/modules/app/src/app/jyutil/clientupdate.go
  71. 1 1
      src/jfw/modules/app/src/app/jyutil/rpccall.go
  72. 0 24
      src/jfw/modules/app/src/app/pay/wxpay.go
  73. 1 37
      src/jfw/modules/app/src/app/tag/msg.go
  74. BIN
      src/jfw/modules/app/src/appsrc
  75. 4 21
      src/jfw/modules/app/src/jfw/config/config.go
  76. 0 212
      src/main_test.go
  77. 0 1
      src/sogousiteverification.txt

+ 0 - 3
.vscode/settings.json

@@ -1,3 +0,0 @@
-{
-  "liveServer.settings.port": 5501
-}

+ 0 - 10
1.html

@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="UTF-8">
-  <title>$Title$</title>
-</head>
-<body>
-$END$
-</body>
-</html>

+ 0 - 17
extend/main.go

@@ -1,17 +0,0 @@
-package main
-
-import (
-	"log"
-	"qfw/util/mongodb"
-)
-
-func main() {
-
-	mongodb.InitMongodbPool(1, "192.168.3.207:27080", "spider")
-	//log.Println(FindById("enterprise", "556d858ec2e875307286f863", `{"_id":1}`))
-	//log.Println(FindOne("identification", "{'o_identificationinfo.s_id':'12312312312312312x','i_identificationtype':2}"))
-	//查id字段
-	log.Println(mongodb.FindById("bidding", "58d8ae66e13823122b666c56", `{"title":1}`))
-	//log.Println((*FindById("user", "5668e447af537458a9000006", `{"credit_a":1}`))["credit_a"].(int64))
-
-}

+ 2 - 2
src/jfw/active/active.go

@@ -1,7 +1,7 @@
 package active
 
 import (
-	public "jfw/public"
+	"jfw/public"
 	"qfw/util"
 
 	"github.com/go-xweb/xweb"
@@ -44,7 +44,7 @@ type Active struct {
 }
 
 var mongodb = public.MQFW
-var se util.SimpleEncrypt = util.SimpleEncrypt{Key: "topnet2015topnet2015"}
+var se = util.SimpleEncrypt{Key: "topnet2015topnet2015"}
 
 func init() {
 	//添加模块解析

+ 2 - 10
src/jfw/active/active_future.go

@@ -21,12 +21,11 @@ import (
 )
 
 //-锁
-var futureLock *sync.Mutex = &sync.Mutex{}
+var futureLock = &sync.Mutex{}
 
 //测试首页
 func (a *Active) FutureIndex(share_openid string) error {
 	defer util.Catch()
-	checkIsSubscribeFlag := true
 	openid, _ := a.Session().Get("s_m_openid").(string)
 	nickname, _ := a.Session().Get("s_nickname").(string)
 	if openid == "" {
@@ -37,14 +36,7 @@ func (a *Active) FutureIndex(share_openid string) error {
 				if code != "" {
 					openid = jyutil.Getopenid(code)
 					if openid != "" {
-						isSubscribe := true
-						if !checkIsSubscribeFlag {
-							checkIsSubscribeFlag = true
-							isSubscribe = CheckUserIsSubscribe(openid)
-						}
-						if isSubscribe {
-							FindUserAndCreateSess(openid, a.Session(), "wx", false)
-						}
+						FindUserAndCreateSess(openid, a.Session(), "wx", false)
 					}
 				}
 			} else {

+ 3 - 10
src/jfw/active/active_seal.go

@@ -45,7 +45,7 @@ func init() {
 	}
 	sealMap = config.Sysconfig["sealAmount"].(map[string]interface{})
 	if sealMap != nil {
-		for k, _ := range sealMap {
+		for k := range sealMap {
 			sealArr = append(sealArr, k)
 		}
 	}
@@ -237,7 +237,7 @@ func (a *Active) ShareSeal(sharetype, openid string) error {
 //用户盖章首页
 func (a *Active) Index() error {
 	defer util.Catch()
-	checkIsSubscribeFlag := true
+
 	redtype := a.GetString("redtype")
 	openid, _ := a.Session().Get("s_m_openid").(string)
 	nickname, _ := a.Session().Get("s_nickname").(string)
@@ -249,14 +249,7 @@ func (a *Active) Index() error {
 				if code != "" {
 					openid := jyutil.Getopenid(code)
 					if openid != "" {
-						isSubscribe := true
-						if !checkIsSubscribeFlag {
-							checkIsSubscribeFlag = true
-							isSubscribe = CheckUserIsSubscribe(openid)
-						}
-						if isSubscribe {
-							FindUserAndCreateSess(openid, a.Session(), "wx", false)
-						}
+						FindUserAndCreateSess(openid, a.Session(), "wx", false)
 					}
 				}
 			} else {

+ 0 - 20
src/jfw/active/zqluckdraw_test.go

@@ -1,20 +0,0 @@
-package active
-
-import (
-	"fmt"
-	"testing"
-	"time"
-)
-
-func Test_getPrize(t *testing.T) {
-	timer1 := time.NewTicker(1 * time.Nanosecond)
-	for i := 0; i < 100; i++ {
-		select {
-		case <-timer1.C:
-			prize := getNewPrize()
-			if prize != "谢谢参与" {
-				fmt.Println(prize)
-			}
-		}
-	}
-}

+ 2 - 3
src/jfw/config/config.go

@@ -7,7 +7,6 @@ import (
 
 //seo.josn 配置文件中的版本号,可以动态更新
 var Seoconfig_Version string
-var TermValidity int
 
 var Sysconfig map[string]interface{}
 var Seoconfig map[string]interface{}
@@ -33,7 +32,7 @@ func init() {
 	mails, _ := Sysconfig["mail"].([]interface{})
 	mailConfigArrMap := util.ObjArrToMapArr(mails)
 	for _, v := range mailConfigArrMap {
-		mail := &mail.GmailAuth{
+		mailConf := &mail.GmailAuth{
 			SmtpHost: v["addr"].(string),
 			SmtpPort: util.IntAll(v["port"]),
 			User:     v["user"].(string),
@@ -41,7 +40,7 @@ func init() {
 			//			PoolChan: nil,
 			//			PoolSize: 0,
 		}
-		GmailAuth = append(GmailAuth, mail)
+		GmailAuth = append(GmailAuth, mailConf)
 	}
 
 	//PC端商机管理配置

+ 0 - 6
src/jfw/course/course.go

@@ -29,12 +29,6 @@ func init() {
 	xweb.AddAction(&CourseInfo{})
 }
 
-var (
-	Collection_name  = "jy_course"
-	Courses_per_page = 50
-	Course_max_pag   = 20
-)
-
 //帮助中心
 func (c *CourseInfo) HelpPage() error {
 	var shareid = c.GetString("id")

+ 0 - 3
src/jfw/course/course_wx.go

@@ -2,7 +2,6 @@ package course
 
 import (
 	"jfw/wx"
-	"log"
 	"qfw/util"
 
 	"github.com/go-xweb/xweb"
@@ -35,7 +34,6 @@ func init() {
 func (c *CourseInfoWX) CourseDetailWX(id string) error {
 	defer util.Catch()
 	userId := util.ObjToString(c.GetSession("userId"))
-	log.Println(userId)
 	if userId == "" {
 		return c.Redirect("/swordfish/about")
 	}
@@ -54,7 +52,6 @@ func (c *CourseInfoWX) CourseDetailWX(id string) error {
 func (c *CourseInfoWX) CourseListWX() error {
 	defer util.Catch()
 	userId := util.ObjToString(c.GetSession("userId"))
-	log.Println(userId)
 	if userId == "" {
 		return c.Redirect("/swordfish/about")
 	}

+ 2 - 2
src/jfw/front/adv.go

@@ -2,10 +2,10 @@ package front
 
 import (
 	"jfw/config"
-	public "jfw/public"
+	"jfw/public"
 	"log"
 	"qfw/util"
-	rpc "qfw/util/rpc"
+	"qfw/util/rpc"
 	"regexp"
 	"strings"
 	"time"

+ 2 - 60
src/jfw/front/applysub.go

@@ -185,9 +185,6 @@ func (e *Applysub) RecList() {
 			  "from": 0,"size": ` + fmt.Sprint(limit) + `
 			}`
 	list := *elastic.Get("entname", "entname", query)
-	//log.Println("list:", list)
-	//re = jylabutil.GetEenNameImmediate(entName, limit)
-	//log.Println("re:", re)
 	if list != nil && len(list) != 0 {
 		e.ServeJson(map[string]interface{}{
 			"recList": list,
@@ -198,7 +195,6 @@ func (e *Applysub) RecList() {
 //
 func (a *Applysub) Index() error {
 	defer util.Catch()
-	checkIsSubscribeFlag := true
 	openid := util.ObjToString(a.GetSession("s_m_openid"))
 	if openid == "" {
 		if a.GetString("state") == "wx" {
@@ -207,14 +203,7 @@ func (a *Applysub) Index() error {
 			if code != "" {
 				openid = jyutil.Getopenid(code)
 				if openid != "" {
-					isSubscribe := true
-					if !checkIsSubscribeFlag {
-						checkIsSubscribeFlag = true
-						isSubscribe = CheckUserIsSubscribe(openid)
-					}
-					if isSubscribe {
-						FindUserAndCreateSess(openid, a.Session(), "wx", false)
-					}
+					FindUserAndCreateSess(openid, a.Session(), "wx", false)
 				}
 			}
 		} else {
@@ -230,52 +219,7 @@ func (a *Applysub) Index() error {
 	a.T["isWeixin"] = 1
 	come := "1"
 	a.T["come"] = come
-	if come == "1" && !public.CheckWxBrowser(a.Request) {
-		return a.Redirect("/front/downloadapppage/normal?source=weixinAutoRpl")
-	}
-	if a.Session().Get("s_m_openid") == nil || openid == "" {
-		return a.Render("/weixin/about.html")
-	}
-	myapply, _ := mongodb.FindOne("applysub_user", `{"s_openid":"`+openid+`"}`)
-	if len(*myapply) > 0 {
-		a.T["isWeixin"] = 1
-		a.T["come"] = 1
-		a.T["flag"] = 1
-		return a.Render("/weixin/about.html")
-	}
-	go func() {
-		var Tval = redis.GetStr("other", "apply_"+openid+"_index")
-		if Tval == "" {
-			timeNow := time.Now()
-			var applyLog = map[string]interface{}{
-				"openid":     openid,
-				"nickname":   a.Session().Get("s_nickname").(string),
-				"year":       timeNow.Year(),
-				"month":      timeNow.Month(),
-				"day":        timeNow.Day(),
-				"hour":       timeNow.Hour(),
-				"minutes":    timeNow.Minute(),
-				"createtime": time.Now().Unix(),
-				"ip":         a.Request.Proto,
-				"refer":      a.Request.Referer(),
-				"client":     a.Request.Header.Get(""),
-				"url":        a.Request.RequestURI,
-				"page":       "index",
-			}
-			if id := mongodb.Save("apply_log", applyLog); len(id) > 0 {
-				redis.Put("other", "apply_"+openid+"_index", "T", 60*60*24)
-			}
-		}
-	}()
-	if tiptext := a.GetString("tiptext"); tiptext != "" {
-		go mongodb.Save("opentip_log", map[string]interface{}{
-			"tiptext":    tiptext,
-			"userid":     util.ObjToString(a.GetSession("userId")),
-			"createtime": time.Now().Unix(),
-			"type":       "applysub",
-		})
-	}
-	return a.Render("/weixin/applysub/index.html")
+	return a.Redirect("/front/downloadapppage/normal?source=weixinAutoRpl")
 }
 
 //
@@ -283,13 +227,11 @@ func (a *Applysub) InfoPage() error {
 	defer util.Catch()
 	openid, _ := a.Session().Get("s_m_openid").(string)
 	a.T["source"] = "apply"
-	//	log.Println("openid:", openid)
 	if openid == "" {
 		a.T["isWeixin"] = 1
 		return a.Render("/weixin/about.html")
 	} else {
 		myapply, _ := mongodb.FindOne("applysub_user", `{"s_openid":"`+openid+`"}`)
-		//		log.Println("---:", len(*myapply))
 		go func() {
 			var Tval = redis.GetStr("other", "apply_"+openid+"_subpage")
 			if Tval == "" {

+ 1 - 1
src/jfw/front/big-member.go

@@ -25,7 +25,7 @@ func (s *BigMemberAction) VIPViewPage(htmlName string) {
 	//大会员介绍页需要使用power字段
 	if bigBaseMsg.Status > 0 && htmlName == "index" {
 		power := []int{}
-		for key, _ := range bigBaseMsg.PowerMap {
+		for key := range bigBaseMsg.PowerMap {
 			power = append(power, key)
 		}
 		s.T["power"] = power

+ 10 - 16
src/jfw/front/commonPayWx.go

@@ -19,15 +19,15 @@ import (
 
 var (
 	titleMap = map[string][]string{
-		"dataexport":   []string{"数据导出"},
-		"subvip":       []string{"超级订阅试用", "超级订阅续费", "超级订阅升级", "超级订阅"},
-		"entniche":     []string{"企业商机管理"},
-		"course":       []string{"招投标课程"},
-		"datareport":   []string{"数据报告"},
-		"onlineCourse": []string{"中标必听课"},
-		"dataPack":     []string{"数据流量包"},
-		"areaPack":     []string{"省份订阅包"},
-		"filePack":     []string{"附件下载包"},
+		"dataexport":   {"数据导出"},
+		"subvip":       {"超级订阅试用", "超级订阅续费", "超级订阅升级", "超级订阅"},
+		"entniche":     {"企业商机管理"},
+		"course":       {"招投标课程"},
+		"datareport":   {"数据报告"},
+		"onlineCourse": {"中标必听课"},
+		"dataPack":     {"数据流量包"},
+		"areaPack":     {"省份订阅包"},
+		"filePack":     {"附件下载包"},
 	}
 )
 
@@ -92,19 +92,13 @@ func (w *WxPayCommon) PaySuccess(doType string) error {
 func (w *WxPayCommon) ToMyWxOrder() error {
 	defer util.Catch()
 	if w.Session().Get("userId") == nil {
-		checkIsSubscribeFlag := true
 		if w.GetString("state") == "wx" {
 			//微信跳回来的
 			code := w.GetString("code")
 			if code != "" {
 				openid := jyutil.Getopenid(code)
 				if openid != "" {
-					isSubscribe := true
-					if !checkIsSubscribeFlag {
-						checkIsSubscribeFlag = true
-						isSubscribe = CheckUserIsSubscribe(openid)
-					}
-					if isSubscribe {
+					if CheckUserIsSubscribe(openid) {
 						FindUserAndCreateSess(openid, w.Session(), "wx", false)
 					}
 				}

+ 2 - 295
src/jfw/front/dataExport.go

@@ -14,7 +14,6 @@ import (
 	"regexp"
 	"strconv"
 	"strings"
-	"sync"
 	"time"
 
 	"github.com/go-xweb/xweb"
@@ -50,14 +49,8 @@ type DataExport struct {
 	integralDetail       xweb.Mapper `xweb:"/front/integral/integralDetail"`             //剑鱼币订单详情
 
 	getPcEntAuth xweb.Mapper `xweb:"/front/entExportAuth/getAuth"` //获取企业权限
-
-	//gettest            xweb.Mapper `xweb:"/front/order/gettest"`                    //模拟
-	//entDataExport      xweb.Mapper `xweb:"/front/entDataExport/(.*)"`               //企业数据导出
-	//isEntExportSuccess xweb.Mapper `xweb:"/front/entExportAuth/isEntExportSuccess"` //企业导出是否成功
 }
 
-var order_pageSize = 10
-
 type Filters struct {
 	FilterId string
 }
@@ -67,15 +60,8 @@ func init() {
 }
 
 var (
-	layout_date         = "2006.01.02"
-	orderStatus_unPaid  = "0"                //订单状态-待支付
-	orderStatus_paid    = "1"                //订单状态-已完成
-	orderStatus_deleted = "-1"               //订单状态-已删除
-	orderStatus_cancel  = "-2"               //订单状态-已取消
-	tableName_order     = "dataexport_order" //订单表
-	SE                  = util.SimpleEncrypt{Key: "topJYBX2019"}
-	exportLock          = sync.Mutex{}
-	exportLockMap       = map[int]sync.Mutex{}
+	layout_date     = "2006.01.02"
+	tableName_order = "dataexport_order" //订单表
 )
 
 func (d *DataExport) ToSieve() error {
@@ -106,57 +92,38 @@ func (d *DataExport) SieveData() error {
 	var cityArr []string
 	var regionArr []string
 	var industryArr []string
-	var subTypeArr []string
 	var buyerArr []string
 	var buyerclassArr []string
 	var winnerArr []string
 	var keywordList []dataexport.KeyWord
 
-	log.Println("price", minPrice, maxPrice)
-	if publishtime != "" {
-		log.Println("publishtime", publishtime)
-	}
 	if area != "" {
 		areaArr = strings.Split(area, ",")
-		log.Println("areaArr", areaArr)
 	}
 	if city != "" {
 		cityArr = strings.Split(city, ",")
-		log.Println("cityArr", cityArr)
 	}
 	if region != "" {
 		regionArr = strings.Split(region, ",")
-		log.Println("regionArr", regionArr)
 	}
 	if industry != "" {
 		industryArr = strings.Split(industry, ",")
 		log.Println("industryArr", industryArr)
 	}
-	if subType != "" {
-		subTypeArr = strings.Split(subType, ",")
-		log.Println("subTypeArr", subTypeArr)
-	}
-	log.Println("keywordParam", keyword)
 	if keyword != "" {
 		err := json.Unmarshal([]byte(keyword), &keywordList)
 		if err != nil {
 			log.Println("keyword param 反序列化异常,查看前后台字段是否对应")
-		} else {
-			log.Println("keywordList", len(keywordList), keywordList)
 		}
 	}
-	log.Println("selectType", selectType)
 	if buyer != "" {
 		buyerArr = strings.Split(buyer, ",")
-		log.Println("buyerArr", buyerArr)
 	}
 	if buyerclass != "" {
 		buyerclassArr = strings.Split(buyerclass, ",")
-		log.Println("buyerclassArr", buyerclassArr)
 	}
 	if winner != "" {
 		winnerArr = strings.Split(winner, ",")
-		log.Println("winnerArr", winnerArr)
 	}
 	sieveCondition := map[string]interface{}{
 		"publishtime": publishtime,
@@ -230,7 +197,6 @@ func (d *DataExport) ToOrderDetail(orderCode string) error {
 	if orderCode != "" {
 		orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
 	}
-	//	log.Println("ToOrderDetail", orderCode, orderDetail)
 	if orderDetail["pay_money"] != nil {
 		orderDetail["pay_money"] = float64(orderDetail["pay_money"].(int64))
 	}
@@ -721,15 +687,6 @@ func (d *DataExport) Check_invoice(order_code string) error {
 	return d.Render("/_error.html")
 }
 
-//func (d *DataExport) Gettest() {
-//	order_code := d.GetString("order_code")
-//	info := public.Mysql.FindOne("invoice", map[string]interface{}{"order_code": order_code}, "", "")
-//	d.ServeJson(map[string]interface{}{
-//		"data": info,
-//	})
-//	return
-//}
-
 func (d *DataExport) InvoicetimeOut() {
 	d.Render("/pc/invoice_error.html")
 }
@@ -743,86 +700,6 @@ func (d *DataExport) ValuationList(order_code string) error {
 	return d.Render("/_error.html")
 }
 
-//
-//func (d *DataExport) EntDataExport(_id string) error {
-//	id := util.SE.Decode4Hex(_id)
-//	userId := util.ObjToString(d.GetSession("userId"))
-//	entId := util.IntAll(d.GetSession("entId"))
-//	entUserId := util.IntAll(d.GetSession("entUserId"))
-//	isFirst, err := d.GetBool("isFirst")
-//	if err != nil {
-//		isFirst = true
-//	}
-//	if userId == "" {
-//		return errors.New("未登录")
-//	}
-//	exportLock.Lock()
-//	exportLockMap[entId] = sync.Mutex{}
-//	entLock := exportLockMap[entId]
-//	exportLock.Unlock()
-//	entLock.Lock()
-//	query := map[string]interface{}{"ent_id": entId, "user_id": entUserId}
-//	data_limit, remain_nums, export_nums := 0, 0, 0
-//	limit := public.Mysql.FindOne("entniche_export_limit", query, "data_limit,remain_nums,export_nums", "")
-//	if limit != nil {
-//		data_limit = util.IntAll((*limit)["data_limit"])
-//		remain_nums = util.IntAll((*limit)["remain_nums"])
-//		export_nums = util.IntAll((*limit)["export_nums"])
-//	}
-//	count := 0
-//	newCount := 0
-//	data := &[]map[string]interface{}{}
-//	current := GetCurrentCount(entId)
-//	log.Println("企业总条数", current)
-//	url := config.Sysconfig["dedupUrl"].(string)
-//	count, newCount, data = public.GetEntDataExportCount(id, entId, entUserId, remain_nums, current, isFirst, util.ObjToString(config.Sysconfig["webdomain"]), url)
-//	isExport := true
-//	isEntExport := true
-//	if newCount > current {
-//		isEntExport = false
-//	}
-//	if newCount > remain_nums {
-//		isExport = false
-//	}
-//	//current 企业总条数   count 筛选条数  newCount 去重后条数  exportNum 今日已导出  limit 今日剩余 limitDay 今日限额
-//	result := map[string]interface{}{
-//		"newCount":    newCount,
-//		"count":       count,
-//		"limit":       remain_nums,
-//		"limitDay":    data_limit,
-//		"exportNum":   export_nums,
-//		"current":     current,
-//		"isExport":    isExport,
-//		"isEntExport": isEntExport,
-//	}
-//	if isFirst || !isExport || !isEntExport {
-//		entLock.Unlock()
-//		d.ServeJson(result)
-//	} else {
-//		go func() {
-//			data = public.FormatExportDatas(data, config.Sysconfig["webdomain"].(string), "2", entId)
-//			xlsxUrl := GetXlsx(*data, entId, entUserId)
-//			if xlsxUrl != "" {
-//				filter := Filters{
-//					FilterId: id,
-//				}
-//				filterStr, _ := json.Marshal(filter)
-//				SaveExportLog(entId, entUserId, count, newCount, remain_nums, export_nums, xlsxUrl, "2", string(filterStr))
-//				DeductNum(entId, newCount)
-//				go func() {
-//					for _, v := range *data {
-//						mongodb.Save("entdataexport", v)
-//					}
-//				}()
-//				redis.Put("other", "entexportdata_"+fmt.Sprintln(entId), xlsxUrl, 60)
-//				entLock.Unlock()
-//			}
-//		}()
-//		d.ServeJson(result)
-//	}
-//	return nil
-//}
-
 //剑鱼pc判断登录用户是否有我的企业、商机管理菜单
 func (this *DataExport) GetPcEntAuth() {
 	userId, _ := this.GetSession("userId").(string)
@@ -900,176 +777,6 @@ func (this *DataExport) GetPcEntAuth() {
 	this.ServeJson(data)
 }
 
-//
-////判断是否导出成功
-//func (this *DataExport) IsEntExportSuccess() {
-//	entId := util.IntAll(this.GetSession("entId"))
-//	res := map[string]interface{}{
-//		"state": false,
-//	}
-//	if entId != 0 {
-//		key := "entexportdata_" + fmt.Sprintln(entId)
-//		log.Println(key)
-//		xlsxUrl := redis.Get("other", key)
-//		log.Println(xlsxUrl)
-//		if xlsxUrl != nil {
-//			res["state"] = true
-//			res["xlsxUrl"] = xlsxUrl
-//			redis.Del("other", key)
-//		}
-//	}
-//	this.ServeJson(res)
-//}
-//
-////生成xlsx
-//func GetXlsx(mMap []map[string]interface{}, entId, entUserId int) string {
-//	xf, err := xlsx.OpenFile("./web/staticres/fields.xlsx")
-//	if err != nil {
-//		log.Println("fields file not foud", err.Error())
-//	}
-//	sh := xf.Sheets[1]
-//	for _, v := range mMap {
-//		row := sh.AddRow()
-//		row.AddCell().SetValue(v["area"])
-//		row.AddCell().SetValue(v["city"])
-//		row.AddCell().SetValue(v["title"])
-//		row.AddCell().SetValue(v["subtype"])
-//		row.AddCell().SetValue(v["detail"])
-//		if v["publishtime"] != nil {
-//			row.AddCell().SetValue(v["publishtime"])
-//		} else {
-//			row.AddCell()
-//		}
-//		row.AddCell().SetValue(v["href"])
-//		row.AddCell().SetValue(v["url"])
-//		row.AddCell().SetValue(v["projectname"])
-//		row.AddCell().SetValue(v["projectcode"])
-//		row.AddCell().SetValue(v["projectscope"])
-//		if v["budget"] != nil {
-//			row.AddCell().SetFloat(util.Float64All(v["budget"]))
-//		} else {
-//			row.AddCell()
-//		}
-//		if v["bidamount"] != nil {
-//			row.AddCell().SetFloat(util.Float64All(v["bidamount"]))
-//		} else {
-//			row.AddCell()
-//		}
-//		if v["bidopentime"] != nil {
-//			row.AddCell().SetValue(v["bidopentime"])
-//		} else {
-//			row.AddCell()
-//		}
-//		row.AddCell().SetValue(v["buyer"])
-//		row.AddCell().SetValue(v["buyerperson"])
-//		row.AddCell().SetValue(v["buyertel"])
-//		row.AddCell().SetValue(v["agency"])
-//		row.AddCell().SetValue(v["s_winner"])
-//		row.AddCell().SetValue(v["winnerperson"])
-//		row.AddCell().SetValue(v["winnertel"])
-//		row.AddCell().SetValue(v["legal_person"])
-//		row.AddCell().SetValue(v["company_phone"])
-//		row.AddCell().SetValue(v["company_email"])
-//	}
-//	xf.Sheets = xf.Sheets[1:2]
-//	xf.Sheets[0].Name = "数据导出"
-//	//生文件
-//	t := strconv.FormatInt(time.Now().Unix(), 10)
-//	entIds := strconv.Itoa(entId)
-//	entUserIds := strconv.Itoa(entUserId)
-//	dir := "./web/staticres/xlsx/entsearchexport/" + entIds + "_" + entUserIds + "_" + t + "/"
-//	if b, _ := PathExists(dir); !b {
-//		err1 := os.MkdirAll(dir, os.ModePerm)
-//		if err1 != nil {
-//			log.Println("mkdir err", dir)
-//		}
-//	}
-//	fname := entIds + "_" + entUserIds + "_" + "entdataexport.xlsx"
-//	xlsxUrl := dir + fname
-//	xlsxUrls := "/xlsx/entsearchexport/" + entIds + "_" + entUserIds + "_" + t + "/" + fname
-//	err = xf.Save(xlsxUrl)
-//	if err != nil {
-//		log.Println("xls error", fname)
-//		xlsxUrls = ""
-//	}
-//	return xlsxUrls
-//}
-//
-//func PathExists(path string) (bool, error) {
-//	_, err := os.Stat(path)
-//	if err == nil {
-//		return true, nil
-//	}
-//	if os.IsNotExist(err) {
-//		return false, nil
-//	}
-//	return false, err
-//}
-//
-//func SaveExportLog(entId, entUserId, count, newCount, remain_nums, export_nums int, xlsxUrl, types, filterStr string) {
-//	query := map[string]interface{}{
-//		"id":     entUserId,
-//		"ent_id": entId,
-//	}
-//	set := map[string]interface{}{
-//		"remain_nums": remain_nums - newCount,
-//		"export_nums": export_nums + newCount,
-//	}
-//	ok := public.Mysql.Update("entniche_export_limit", map[string]interface{}{"ent_id": entId, "user_id": entUserId}, set)
-//	if !ok {
-//		log.Println("修改导出条数失败", query, remain_nums, newCount)
-//	}
-//	userData := public.Mysql.FindOne("entniche_user", query, "name,phone", "")
-//	if userData != nil {
-//		name := util.ObjToString((*userData)["name"])
-//		phone := util.ObjToString((*userData)["phone"])
-//		now := time.Now()
-//		public.Mysql.Insert("entniche_export_log", map[string]interface{}{
-//			"user_name":    name,
-//			"export_time":  util.FormatDate(&now, util.Date_Full_Layout),
-//			"data_source":  "2",
-//			"export_num":   count,
-//			"deduct_num":   newCount,
-//			"download_url": xlsxUrl,
-//			"ent_id":       entId,
-//			"phone":        phone,
-//			"user_id":      entUserId,
-//			"filter":       filterStr,
-//		})
-//	}
-//}
-//
-//func DeductNum(entId, newCount int) {
-//	query := map[string]interface{}{
-//		"id": entId,
-//	}
-//	userData := public.Mysql.FindOne("entniche_info", query, "name,phone", "")
-//	if userData != nil {
-//		name := util.ObjToString((*userData)["name"])
-//		phone := util.ObjToString((*userData)["phone"])
-//		public.Mgo_Qyfw.Update("user", map[string]interface{}{"phone": phone, "username": name}, map[string]interface{}{
-//			"$inc": map[string]interface{}{
-//				"plan.current": -newCount,
-//			},
-//		}, false, false)
-//	}
-//}
-//
-//func GetCurrentCount(entId int) int {
-//	count := 0
-//	userData := public.Mysql.FindOne("entniche_info", map[string]interface{}{"id": entId}, "name,phone", "")
-//	if userData == nil {
-//		return count
-//	}
-//	current, ok := public.Mgo_Qyfw.FindOne("user", map[string]interface{}{"phone": util.ObjToString((*userData)["phone"]), "username": util.ObjToString((*userData)["name"])})
-//	if current == nil || !ok {
-//		return count
-//	}
-//	plan, _ := (*current)["plan"].(map[string]interface{})
-//	count = util.IntAll(plan["current"])
-//	return count
-//}
-
 //获取当前登录用户的手机号
 func GetPhone(userId string) (string, string) {
 	u, ok := mongodb.FindById("user", userId, `{"s_phone":1,"s_m_phone":1}`)

+ 0 - 99
src/jfw/front/dealinfo.go

@@ -1,99 +0,0 @@
-package front
-
-import (
-	//"encoding/json"
-	"jfw/config"
-	//"mfw/util"
-	qutil "qfw/util"
-	"regexp"
-	//"strings"
-)
-
-//var client *util.Client
-var reg = regexp.MustCompile("^[0-9a-zA-Z-.]+$")
-var reg_space = regexp.MustCompile("(?ism)(<style.*?>.*?</style>)|([.#]?\\w{1,20}\\{.*?\\})|(<.*?>)|(\\\\t)+|\\t|( +)|( +)|(" + string(rune(160)) + "+)")
-var reg_row = regexp.MustCompile("(?i)<(tr|div|p)[^>]*?>|(\\n)+")
-var reg_dh = regexp.MustCompile("[,]+")
-var reg_newdb = regexp.MustCompile("([:,、:,。.;])[,]")
-var reg_no = regexp.MustCompile("^[0-9]*$")
-var MSG_SERVER = "123.56.236.148:7070"
-var DesLen = 120
-
-func init_2() {
-	ser := qutil.ObjToString(config.Sysconfig["msg_server"])
-	if ser != "" {
-		MSG_SERVER = ser
-	}
-	//client, _ = util.StartClient(func(p *util.Packet) {
-	//异步调用
-	//}, MSG_SERVER, "剑鱼标讯抽关键词", []int{})
-}
-
-//func DealInfo_1(obj *map[string]interface{}, coll string) {
-//	defer qutil.Catch()
-//	if (*obj)["keywords"] != nil && (*obj)["description"] != nil {
-//		return
-//	} else {
-//		(*obj)["keywords"] = ""
-//		(*obj)["description"] = ""
-//	}
-//	title := qutil.ObjToString((*obj)["title"])
-//	ret, _ := client.Call("", util.UUID(8), 4010, util.SENDTO_TYPE_RAND_RECIVER, title, 3)
-//	var m [][]string
-//	json.Unmarshal(ret, &m)
-//	arr := []string{}
-//	keyword := []string{}
-//	keywordnew := []string{}
-//	for _, tmp := range m {
-//		if reg.MatchString(tmp[0]) {
-//			arr = append(arr, tmp[0])
-//		} else {
-//			if len(arr) > 0 {
-//				str := strings.Join(arr, "")
-//				keyword = append(keyword, str)
-//				arr = []string{}
-//			}
-//			if len(tmp[0]) > 3 && (strings.HasPrefix(tmp[1], "n") || tmp[1] == "v" || tmp[1] == "vn" || strings.HasPrefix(tmp[1], "g")) {
-//				keyword = append(keyword, tmp[0])
-//			}
-//		}
-//	}
-//	for _, v := range keyword {
-//		v = reg_no.ReplaceAllString(v, "")
-//		if len(v) > 0 {
-//			keywordnew = append(keywordnew, v)
-//		}
-//	}
-//	keywords := strings.Join(keywordnew, ",")
-//	(*obj)["keywords"] = keywords
-//	content := ""
-//	if (*obj)["detail_bak"] != nil {
-//		content = qutil.ObjToString((*obj)["detail_bak"])
-//	} else {
-//		content = qutil.ObjToString((*obj)["detail"])
-//	}
-//	//内容替换
-//	content = strings.Replace(content, " ", "", -1)
-//	content = reg_space.ReplaceAllString(content, "")
-//	content = reg_row.ReplaceAllString(content, ",")
-//	content = reg_dh.ReplaceAllString(content, ",")
-//	content = reg_newdb.ReplaceAllString(content, "$1")
-//	if strings.HasPrefix(content, ",") {
-//		content = content[1:]
-//	}
-//	//log.Println(content)
-//	tc := []rune(content)
-//	ltc := len(tc)
-//	description := content
-//	if ltc > DesLen {
-//		description = string(tc[:DesLen])
-//	}
-//	(*obj)["description"] = description
-//	//保存到数据库
-//	_id := (*obj)["_id"]
-//	go mongodb.Update(coll, &map[string]interface{}{"_id": _id}, &map[string]interface{}{"$set": map[string]interface{}{
-//		"keywords":    keywords,
-//		"description": description,
-//	}}, false, false)
-//	return
-//}

+ 0 - 8
src/jfw/front/distribution.go

@@ -22,7 +22,6 @@ type Distrib struct {
 }
 
 var suffix_msgt = "_SX"
-var Date_Full_Layout = "2006-01-02 15:04:05"
 
 func init() {
 	xweb.AddAction(&Distrib{})
@@ -65,7 +64,6 @@ func (this *Distrib) LinkShare(discored string) error {
 
 	userId, _ := this.Session().Get("userId").(string)
 	go this.ShareLogs(discored, userId)
-	log.Println("openid:", openid)
 	if !checkIsSubscribeFlag {
 		if discored == "" {
 			log.Println(userId, "分销用户微信分享错误")
@@ -113,8 +111,6 @@ func (this *Distrib) LinkShareX(discored string) error {
 	}
 	userId, _ := this.Session().Get("userId").(string)
 	go this.ShareLogs(discored, userId)
-	log.Println("openid:", openid)
-	log.Println("DIS_" + discored[1:])
 	if !checkIsSubscribeFlag {
 		if discored == "" {
 			log.Println(userId, "分销用户微信分享错误")
@@ -163,8 +159,6 @@ func (this *Distrib) LinkShareG(discored string) error {
 
 	userId, _ := this.Session().Get("userId").(string)
 	go this.ShareLogs(discored, userId)
-	log.Println("openid:", openid)
-	log.Println("DIS_" + discored[1:])
 	if !checkIsSubscribeFlag {
 		if discored == "" {
 			log.Println(userId, "分销用户微信分享错误")
@@ -213,8 +207,6 @@ func (this *Distrib) LinkShareE(discored string) error {
 
 	userId, _ := this.Session().Get("userId").(string)
 	go this.ShareLogs(discored, userId)
-	log.Println("openid:", openid)
-	log.Println("DIS_" + discored[1:])
 	if !checkIsSubscribeFlag {
 		if discored == "" {
 			log.Println(userId, "分销用户微信分享错误")

+ 0 - 1
src/jfw/front/entsearch.go

@@ -51,7 +51,6 @@ func (e *Entsearch) Bidsearchforentindex() error {
 	s_maxprice := e.GetString("maxprice")
 	minprice, _ := strconv.ParseFloat(s_minprice, 64)
 	maxprice, _ := strconv.ParseFloat(s_maxprice, 64)
-	//log.Println("pricetype minprice maxprice searchvalue:", pricetype, minprice, maxprice, searchvalue)
 	if pricetype == "y" {
 		//搜索minprice和maxprice价格区间的数据
 	}

+ 1051 - 1062
src/jfw/front/follow.go

@@ -1,1062 +1,1051 @@
-package front
-
-import (
-	"encoding/base64"
-	"errors"
-	"fmt"
-	"jfw/config"
-	"jfw/jyutil"
-	public "jfw/public"
-	"jfw/wx"
-	"log"
-	. "mongodb"
-	"net/url"
-	"qfw/util"
-	"qfw/util/elastic"
-	"qfw/util/jy"
-	"qfw/util/redis"
-	rpc "qfw/util/rpc"
-	"strings"
-	"time"
-
-	"github.com/SKatiyar/qr"
-
-	"github.com/go-xweb/xweb"
-	"go.mongodb.org/mongo-driver/bson"
-	"go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-type Follow struct {
-	*xweb.Action
-	ajaxReq        xweb.Mapper `xweb:"/follow/ajaxReq"` //关注项目ajax请求
-	list           xweb.Mapper `xweb:"/follow/list"`    //我关注的项目
-	add            xweb.Mapper `xweb:"/follow/add"`     //添加关注项目
-	addsave        xweb.Mapper `xweb:"/follow/addsave"`
-	set            xweb.Mapper `xweb:"/follow/set/(\\w+)/([^.]*)"`
-	notice         xweb.Mapper `xweb:"/follow/notice/([^.]+)/([^.]*)"` //项目公告
-	allNotice      xweb.Mapper `xweb:"/follow/allNotice"`              //项目公告/(.*)
-	visited        xweb.Mapper `xweb:"/follow/notice/visited"`
-	photo          xweb.Mapper `xweb:"/follow/photo/(.*)"`
-	fwsave         xweb.Mapper `xweb:"/follow/fwsave"`
-	mylist         xweb.Mapper `xweb:"/follow/mylist"`
-	checkFPStatus  xweb.Mapper `xweb:"/follow/checkFPStatus"`
-	checkCStatus   xweb.Mapper `xweb:"/follow/checkCStatus"`
-	shareFW        xweb.Mapper `xweb:"/follow/shareFW/([^.]*)"`
-	pcAllNotice    xweb.Mapper `xweb:"/front/pcAllNotice"`
-	pcEntAllNotice xweb.Mapper `xweb:"/front/pcEntAllNotice"`
-	//分享拉新领取超级订阅
-	followGift xweb.Mapper `xweb:"/front/followGift/(.*)"`
-}
-
-var followLimit int
-
-func init() {
-	xweb.AddAction(&Follow{})
-	followLimit = util.IntAllDef(config.Sysconfig["followProject"], 10)
-}
-
-//
-func (m *Follow) CheckFPStatus() error {
-	defer util.Catch()
-	s_id := util.DecodeArticleId2ByCheck(m.GetString("s_id"))[0]
-	follows, _ := mongodb.FindById("follow_project", s_id, `{"_id":1}`)
-	flag := "f"
-	if follows != nil && *follows != nil && len(*follows) > 0 {
-		flag = "t"
-	}
-	m.ServeJson(map[string]interface{}{
-		"flag": flag,
-	})
-	return nil
-}
-
-//
-func (m *Follow) CheckCStatus() error {
-	defer util.Catch()
-	pname := m.GetString("pcname")
-	pcode := m.GetString("pccode")
-	userId, _ := m.GetSession("userId").(string)
-	openId, _ := m.GetSession("s_m_openid").(string)
-	flag := false
-	followid := ""
-	if userId != "" {
-		flag, followid = MFollow(userId, pname, pcode, "", openId)
-	}
-	m.ServeJson(map[string]interface{}{
-		"flag":     flag,
-		"followid": followid,
-	})
-	return nil
-}
-
-//
-func (m *Follow) Mylist() {
-	defer util.Catch()
-	id := m.GetString("id")
-	id = util.DecodeArticleId2ByCheck(id)[0]
-	var flag = "F"
-	res, ok := mongodb.FindById("follow_project", id, `{"title":1}`)
-	if ok && res != nil && len(*res) > 0 {
-		flag = "T"
-	}
-	m.ServeJson(map[string]interface{}{
-		"flag": flag,
-	})
-}
-
-//关注列表关注
-func (m *Follow) Fwsave() {
-	defer util.Catch()
-	userId := m.GetSession("userId").(string)
-	openid := m.GetSession("s_m_openid").(string)
-	var status = "n"
-	var followId string
-	s_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-	if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
-		status = "m"
-	} else if mongodb.Count("follow_project", `{"s_userid":"`+userId+`","s_id":"`+s_id+`"}`) > 0 {
-		status = "e"
-	} else {
-		data := make(map[string]interface{})
-		if remind, _ := m.GetInteger("remind"); remind == 1 {
-			data["i_remind"] = 1
-		} else {
-			data["i_remind"] = 0
-		}
-		if bidopentime, err := m.GetInt("bidopentime"); err == nil {
-			data["l_bidopentime"] = bidopentime
-		}
-		if remindtime, err := m.GetInt("remindtime"); err == nil {
-			data["l_remindtime"] = remindtime
-		}
-		projectname := m.GetString("projectname")
-		data["s_projectname"] = projectname
-		data["s_userid"] = userId
-		data["s_openid"] = openid
-		data["l_createtime"] = time.Now().Unix()
-		data["s_title"] = projectname
-		data["s_id"] = s_id
-		data["i_source"] = 3
-		data["toptype"] = "招标"
-		fields := `"title","comeintime","bidopentime","projectcode","type","href","publishtime","area","subtype","toptype","industry","s_subscopeclass"`
-		res := elastic.GetByIdField("bidding", "bidding", s_id, fields)
-		if res != nil {
-			projectcode, _ := (*res)["projectcode"].(string)
-			data["s_projectcode"] = projectcode
-			data["s_title"] = (*res)["title"]
-			data["s_type"] = (*res)["type"]
-			data["l_publishtime"] = (*res)["publishtime"]
-			data["s_area"] = (*res)["area"]
-			data["s_url"] = (*res)["href"]
-			data["s_province"] = (*res)["area"]
-			data["l_comeintime"] = (*res)["comeintime"]
-			if data["l_bidopentime"] == "" {
-				data["l_bidopentime"] = (*res)["bidopentime"]
-			}
-			mySelf := make(bson.M)
-			mySelf["s_projectname"] = projectname
-			mySelf["s_title"] = (*res)["title"]
-			mySelf["s_projectcode"] = projectcode
-			mySelf["s_url"] = (*res)["href"]
-			mySelf["s_type"] = (*res)["type"]
-			mySelf["s_subtype"] = (*res)["subtype"]
-			mySelf["s_toptype"] = (*res)["toptype"]
-			mySelf["s_province"] = (*res)["area"]
-			mySelf["s_id"] = s_id
-			mySelf["s_eid"] = util.EncodeArticleId2ByCheck(s_id)
-			mySelf["l_publishtime"] = (*res)["publishtime"]
-			if (*res)["industry"] == nil && (*res)["s_subscopeclass"] != nil {
-				ind := strings.Split(util.ObjToString((*res)["s_subscopeclass"]), ",")[0]
-				data["s_industry"] = strings.Split(ind, "_")[0]
-				mySelf["s_industry"] = strings.Split(ind, "_")[0]
-			} else {
-				data["s_industry"] = (*res)["industry"]
-				mySelf["s_industry"] = (*res)["industry"]
-			}
-			data["a_relationinfo"] = []map[string]interface{}{mySelf}
-			if followId = mongodb.Save("follow_project", data); len(followId) > 0 {
-				status = "y"
-				go public.FollowPush(&rpc.FollowPush{
-					ProjectName: projectname,
-					ProjectCode: projectcode,
-					InfoId:      s_id,
-					FollowId:    followId,
-					UserId:      userId,
-				})
-			}
-		}
-	}
-	m.ServeJson(map[string]interface{}{
-		"status":   status,
-		"followId": util.EncodeArticleId2ByCheck(followId),
-		"infoId":   util.EncodeArticleId2ByCheck(s_id),
-	})
-}
-
-//分享关注项目
-func (m *Follow) ShareFW(tp string) error {
-	defer util.Catch()
-	tpm := strings.Split(tp, "__")
-	id := util.DecodeArticleId2ByCheck(tpm[0])[0]
-	projectname := tpm[1]
-	openid := tpm[2]
-	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-	mynickname, _ := m.Session().Get("s_nickname").(string)
-	myavatar, _ := m.Session().Get("s_avatar").(string)
-	m.T["nickname"] = mynickname
-	m.T["avatar"] = myavatar
-	userId := m.GetSession("userId")
-	if userId != "" && userId != nil {
-		m.T["userId"] = userId.(string)
-	}
-	projectcode := ""
-	m.T["projectname"] = projectname
-	m.T["projectcode"] = projectcode
-	m.T["fg"] = "F"
-	fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area"`
-	data := elastic.GetByIdField("bidding", "bidding", id, fields)
-	bidopentime := (*data)["bidopentime"]
-	if bidopentime != nil && util.Int64All(bidopentime) != 0 {
-		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 && util.Int64All(remindtime) != 0 {
-		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 && util.Int64All(bidopentime) != 0 {
-		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()
-	}
-	mySelf := make(bson.M)
-	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["l_publishtime"] = (*data)["publishtime"]
-	if len(projectname) > 0 || len(projectcode) > 0 {
-		res, _ := public.FollowPush(&rpc.FollowPush{
-			ProjectName: projectname,
-			ProjectCode: projectcode,
-			InfoId:      id,
-			FollowId:    "",
-			UserId:      "",
-			Flag:        1,
-		})
-		if len(res) > 0 || len(mySelf) > 0 {
-			m.T["fg"] = "T"
-			m.T["data"] = res
-			m.T["id"] = id
-			m.T["mySelf"] = mySelf
-			m.T["openid"] = openid
-		}
-	}
-	return m.Render("/weixin/follow/shareset.html", &m.T)
-}
-
-//
-func (m *Follow) PcAllNotice() error {
-	defer util.Catch()
-	id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-	projectname := m.GetString("projectname")
-	projectcode := m.GetString("projectcode")
-	//log.Println(projectname, "id:", id)
-	data := map[string]interface{}{}
-	if len(projectname) > 0 || len(projectcode) > 0 {
-		res, _ := public.FollowPush(&rpc.FollowPush{
-			ProjectName: projectname,
-			ProjectCode: projectcode,
-			InfoId:      id,
-			FollowId:    "",
-			UserId:      "",
-			Flag:        1,
-		})
-		if len(res) > 0 {
-			for _, v := range res {
-				(*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
-			}
-			data["res"] = res
-		}
-	}
-
-	m.ServeJson(map[string]interface{}{
-		"data": data,
-	})
-	return nil
-}
-
-//中标企业公告列表
-func (m *Follow) PcEntAllNotice() error {
-	defer util.Catch()
-	entname := m.GetString("entname")
-	data := map[string]interface{}{}
-	if entname != "" {
-		entname_a := strings.Split(entname, ",")
-		for _, v := range entname_a {
-			if v != "" {
-				fields := `"_id","projectname","bidamount","title","publishtime","subtype","toptype","href"`
-				res := elastic.GetPage("bidding", "bidding", `{"TERM_s_winner":"`+v+`"}`, `{"publishtime":-1}`, fields, 0, 100)
-				if len(*res) != 0 && res != nil && *res != nil {
-					for _, v := range *res {
-						v["_id"] = util.EncodeArticleId2ByCheck(BsonIdToSId(v["_id"]))
-					}
-					data[v] = res
-				}
-			}
-		}
-	}
-	m.ServeJson(map[string]interface{}{
-		"data": data,
-	})
-	return nil
-}
-
-//未关注项目
-func (m *Follow) Photo(tp string) error {
-	defer util.Catch()
-	followid := ""
-	tpm := strings.Split(tp, "__")
-	projectname := tpm[1]
-	projectcode := tpm[2]
-	userid, _ := m.GetSession("userId").(string)
-	openid := m.GetSession("s_m_openid").(string)
-	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}`
-		_id, _ := primitive.ObjectIDFromHex(id)
-		data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
-			"_id":      _id,
-			"s_userid": userid,
-		}, 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
-		}
-		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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
-			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 && l_remindtime != "" && util.Int64All(l_remindtime) != 0 {
-			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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
-			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()
-		}
-	} else { //未关注
-		id := util.DecodeArticleId2ByCheck(tpm[0])[0]
-		m.T["projectname"] = projectname
-		m.T["projectcode"] = projectcode
-		//log.Println("id:", id)
-		fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area","industry","s_subscopeclass"`
-		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"]
-			if (*data)["industry"] == nil && (*data)["s_subscopeclass"] != nil {
-				ind := strings.Split(util.ObjToString((*data)["s_subscopeclass"]), ",")[0]
-				(*data)["industry"] = strings.Split(ind, "_")[0]
-				mySelf["s_industry"] = strings.Split(ind, "_")[0]
-			}
-			////////////////////////
-			bidopentime := (*data)["bidopentime"]
-			if bidopentime != nil && bidopentime != "" && util.Int64All(bidopentime) != 0 {
-				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 && remindtime != "" && util.Int64All(remindtime) != 0 {
-				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 && bidopentime != "" && util.Int64All(bidopentime) != 0 {
-				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, _ := public.FollowPush(&rpc.FollowPush{
-				ProjectName: projectname,
-				ProjectCode: projectcode,
-				InfoId:      id,
-				FollowId:    "",
-				UserId:      m.GetSession("userId").(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
-	}
-	myopenid, _ := m.Session().Get("s_m_openid").(string)
-	m.T["openid"] = se.EncodeString(myopenid)
-	mynickname, _ := m.Session().Get("s_nickname").(string)
-	myavatar, _ := m.Session().Get("s_avatar").(string)
-	m.T["nickname"] = mynickname
-	m.T["avatar"] = myavatar
-	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-	return m.Render("/weixin/follow/set.html", &m.T)
-}
-
-//关注项目相关的ajax请求
-func (m *Follow) AjaxReq() {
-	defer util.Catch()
-	userId := m.GetSession("userId").(string)
-	openid := m.GetSession("s_m_openid").(string)
-	var status = "n"
-	reqType := m.GetString("reqType")
-	var followId string
-	if reqType == "follow" { //快照页面关注
-		s_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-		if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
-			status = "m"
-		} else if mongodb.Count("follow_project", `{"s_userid":"`+userId+`","s_id":"`+s_id+`"}`) > 0 {
-			status = "e"
-		} else {
-			publishtime, _ := m.GetInt("publishtime")
-			projectname := m.GetString("projectname")
-			projectcode := m.GetString("projectcode")
-			url := m.GetString("url")
-			title := m.GetString("title")
-			area := m.GetString("area")
-			subtype := m.GetString("subtype")
-			toptype := m.GetString("toptype")
-			s_type := m.GetString("type")
-			s_industry := m.GetString("industry")
-			if projectname != "" || projectcode != "" {
-				data := map[string]interface{}{
-					"s_userid":      userId,
-					"s_openid":      openid,
-					"s_id":          s_id,
-					"s_url":         url,
-					"s_title":       title,
-					"l_createtime":  time.Now().Unix(),
-					"i_remind":      0,
-					"l_publishtime": publishtime,
-					"i_source":      1,
-					"s_province":    area,
-					"s_area":        area,
-					"s_type":        s_type,
-					"s_industry":    s_industry,
-					"toptype":       "招标",
-				}
-				if comeintime, err := m.GetInt("comeintime"); err == nil {
-					data["l_comeintime"] = comeintime
-				}
-				if s_type := m.GetString("type"); s_type != "" {
-					data["s_type"] = s_type
-				}
-				if projectname != "" {
-					data["s_projectname"] = projectname
-				} else {
-					data["s_projectname"] = title
-				}
-				if projectcode != "" {
-					data["s_projectcode"] = projectcode
-				}
-				if bidopentime, err := m.GetInt("bidopentime"); err == nil && bidopentime > 0 {
-					data["l_bidopentime"] = bidopentime
-				}
-				//
-				mySelf := make(bson.M)
-				mySelf["s_projectcode"] = projectcode
-				mySelf["s_projectname"] = projectname
-				mySelf["s_title"] = title
-				mySelf["s_url"] = url
-				mySelf["s_id"] = s_id
-				mySelf["s_eid"] = util.EncodeArticleId2ByCheck(s_id)
-				mySelf["l_publishtime"] = publishtime
-				mySelf["s_province"] = area
-				mySelf["s_subtype"] = subtype
-				mySelf["s_toptype"] = toptype
-				mySelf["s_type"] = s_type
-				mySelf["s_industry"] = s_industry
-				//
-				data["a_relationinfo"] = []map[string]interface{}{mySelf}
-				if followId = mongodb.Save("follow_project", data); len(followId) > 0 {
-					status = "y"
-					go public.FollowPush(&rpc.FollowPush{
-						ProjectName: projectname,
-						ProjectCode: projectcode,
-						InfoId:      s_id,
-						FollowId:    followId,
-						UserId:      userId,
-					})
-				}
-			}
-		}
-	} else if reqType == "cancel" { //取消关注
-		if data, ok := mongodb.FindOne("follow_project", `{"s_userid":"`+userId+`","_id":"`+util.DecodeArticleId2ByCheck(m.GetString("id"))[0]+`"}`); ok && data != nil {
-			(*data)["s_followid"] = BsonIdToSId((*data)["_id"])
-			delete(*data, "_id")
-			(*data)["i_status"] = 1
-			mongodb.Save("follow_project_back", data)
-			if mongodb.Del("follow_project", `{"s_userid":"`+(*data)["s_userid"].(string)+`","_id":"`+util.DecodeArticleId2ByCheck(m.GetString("id"))[0]+`"}`) {
-				status = "y"
-				go delRelRedis((*data)["s_userid"], (*data)["a_relationinfo"])
-			}
-		}
-	} else if reqType == "followset" {
-		id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-		_id, _ := primitive.ObjectIDFromHex(id)
-		if mongodb.Count("follow_project", map[string]interface{}{"_id": _id, "s_userid": userId}) == 1 {
-			data := make(map[string]interface{})
-			data["l_updatetime"] = time.Now().Unix()
-			if remind, _ := m.GetInteger("remind"); remind == 1 {
-				data["i_remind"] = 1
-			} else {
-				data["i_remind"] = 0
-			}
-			if bidopentime, err := m.GetInt("bidopentime"); err == nil {
-				data["l_bidopentime"] = bidopentime
-			}
-			if remindtime, err := m.GetInt("remindtime"); err == nil {
-				data["l_remindtime"] = remindtime
-			}
-			if mongodb.Update("follow_project", `{"_id":"`+id+`"}`, map[string]interface{}{"$set": data}, false, false) {
-				status = "y"
-			}
-		}
-	}
-	m.ServeJson(map[string]interface{}{
-		"status":   status,
-		"followId": util.EncodeArticleId2ByCheck(followId),
-	})
-}
-
-//我关注的项目
-func (m *Follow) List() error {
-	defer util.Catch()
-	myopenid, _ := m.Session().Get("s_m_openid").(string)
-	userId := util.ObjToString(m.Session().Get("userId"))
-	if userId == "" {
-		log.Println("查询我关注的项目出错,userid为空")
-		return errors.New("查询我关注的项目出错,userid为空")
-	}
-	datas, ok := mongodb.Find("follow_project", `{"s_userid":"`+userId+`"}`, `{"l_lastpushtime":-1,"l_createtime":-1}`, `{"s_projectname":1,"s_projectcode":1,"i_remind":1,"l_lastpushtime":1,"l_createtime":1,"s_industry":1,"s_area":1}`, false, -1, -1)
-	m.T["flag"] = false
-	if ok && datas != nil && len(*datas) > 0 {
-		for _, v := range *datas {
-			v["_id"] = util.EncodeArticleId2ByCheck(BsonIdToSId(v["_id"]))
-			if v["l_lastpushtime"] == "" || v["l_lastpushtime"] == nil {
-				v["l_lastpushtime"] = v["l_createtime"]
-			}
-		}
-		m.T["datas"] = datas
-		if len(*datas) >= followLimit {
-			m.T["flag"] = true
-		}
-	}
-	m.T["openid"] = se.EncodeString(myopenid)
-	mynickname, _ := m.Session().Get("s_nickname").(string)
-	myavatar, _ := m.Session().Get("s_avatar").(string)
-	m.T["nickname"] = mynickname
-	m.T["avatar"] = myavatar
-	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-	m.T["followLimit"] = followLimit
-	return m.Render("/weixin/follow/list.html", &m.T)
-}
-
-//添加关注项目
-func (m *Follow) Add() error {
-	myopenid, _ := m.Session().Get("s_m_openid").(string)
-	m.T["openid"] = se.EncodeString(myopenid)
-	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-	mynickname, _ := m.Session().Get("s_nickname").(string)
-	myavatar, _ := m.Session().Get("s_avatar").(string)
-	m.T["nickname"] = mynickname
-	m.T["avatar"] = myavatar
-	return m.Render("/weixin/follow/add.html", &m.T)
-}
-
-//手动添加关注项目
-func (m *Follow) Addsave() error {
-	defer util.Catch()
-	var status = "n"
-	var id string
-	userId := m.GetSession("userId").(string)
-	openid := m.GetSession("s_m_openid").(string)
-	if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
-		status = "m"
-	} else {
-		if projectname := m.GetString("projectname"); projectname != "" {
-			data := map[string]interface{}{
-				"s_userid":      userId,
-				"s_openid":      openid,
-				"s_projectname": projectname,
-				"l_createtime":  time.Now().Unix(),
-				"i_remind":      0,
-				"s_title":       projectname,
-				"i_source":      2,
-				"toptype":       "招标",
-			}
-			//匹配
-			r := elastic.GetPage("bidding", "bidding", `{"TERM_projectname":"`+projectname+`"}`, `{"comeintime":-1}`, `"_id","title","comeintime","bidopentime","projectcode","type","href","publishtime","subtype","toptype","area","industry","s_subscopeclass"`, -1, -1)
-			var matchingFlag = r != nil && len(*r) != 0
-			var projectcode, sid string
-			if matchingFlag {
-				d := (*r)[0]
-				sid = d["_id"].(string) //(d["_id"].(bson.ObjectId)).Hex()
-				data["s_id"] = sid
-				data["l_comeintime"] = d["comeintime"]
-				publishtime := d["publishtime"]
-				data["l_publishtime"] = publishtime
-				data["s_title"] = d["title"]
-				data["s_area"] = d["area"]
-				data["s_province"] = d["area"]
-				if bidopentime := d["bidopentime"]; bidopentime != nil && util.Int64All(bidopentime) != 0 {
-					data["l_bidopentime"] = bidopentime
-				}
-				if d["projectcode"] != nil {
-					projectcode = d["projectcode"].(string)
-					data["s_projectcode"] = projectcode
-				}
-				if s_type := d["type"]; s_type != nil {
-					data["s_type"] = s_type
-				}
-				url := d["href"].(string)
-				data["s_url"] = url
-				//
-				mySelf := make(bson.M)
-				mySelf["s_type"] = util.ObjToString(d["type"])
-				mySelf["s_toptype"] = util.ObjToString(d["toptype"])
-				mySelf["s_subtype"] = util.ObjToString(d["subtype"])
-				mySelf["s_province"] = util.ObjToString(d["area"])
-				mySelf["s_projectname"] = projectname
-				mySelf["s_title"] = d["title"]
-				mySelf["s_projectcode"] = projectcode
-				mySelf["s_url"] = url
-				mySelf["s_id"] = sid
-				mySelf["s_eid"] = util.EncodeArticleId2ByCheck(sid)
-				mySelf["l_publishtime"] = publishtime
-				if d["industry"] == nil && d["s_subscopeclass"] != nil {
-					ind := strings.Split(util.ObjToString(d["s_subscopeclass"]), ",")[0]
-					data["s_industry"] = strings.Split(ind, "_")[0]
-					mySelf["s_industry"] = strings.Split(ind, "_")[0]
-				} else {
-					data["s_industry"] = d["industry"]
-					mySelf["s_industry"] = d["industry"]
-				}
-				data["a_relationinfo"] = []map[string]interface{}{mySelf}
-			}
-			if id = mongodb.Save("follow_project", data); len(id) > 0 {
-				status = "y"
-				go public.FollowPush(&rpc.FollowPush{
-					ProjectName: projectname,
-					ProjectCode: projectcode,
-					InfoId:      sid,
-					FollowId:    id,
-					UserId:      userId,
-				})
-			}
-		}
-	}
-	m.ServeJson(map[string]interface{}{
-		"status": status,
-		"id":     util.EncodeArticleId2ByCheck(id),
-	})
-	return nil
-}
-func (m *Follow) Set(tp, id string) error {
-	defer util.Catch()
-	isDel := false
-	id = util.DecodeArticleId2ByCheck(id)[0]
-	userid := util.ObjToString(m.GetSession("userId"))
-	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,"s_userid":1}`
-	_id, _ := primitive.ObjectIDFromHex(id)
-	data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
-		"_id": _id,
-	}, fields)
-	if ok && (data == nil || len(*data) == 0) {
-		data, ok = mongodb.FindOneByField("follow_project_back", `{"s_followid":"`+id+`"}`, fields)
-		isDel = true
-	}
-	if !ok || data == nil || len(*data) == 0 {
-		return m.Render("_error.html")
-	}
-	sid, _ := (*data)["s_id"].(string)
-	projectname, _ := (*data)["s_projectname"].(string)
-	projectcode, _ := (*data)["s_projectcode"].(string)
-	if util.ObjToString((*data)["s_userid"]) != userid {
-		return m.Redirect(fmt.Sprintf("/follow/photo/%s__%s__%s", util.EncodeArticleId2ByCheck(sid), projectname, projectcode))
-	}
-	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 && bidopentime != "" && util.Int64All(bidopentime) != 0 {
-				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 && remindtime != "" && util.Int64All(remindtime) != 0 {
-				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 && bidopentime != "" && util.Int64All(bidopentime) != 0 {
-				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, _ := public.FollowPush(&rpc.FollowPush{
-				ProjectName: projectname,
-				ProjectCode: projectcode,
-				InfoId:      sid,
-				FollowId:    "",
-				UserId:      m.GetSession("userId").(string),
-				Flag:        1,
-			})
-			if len(res) > 0 || len(mySelf) > 0 {
-				for _, v := range res {
-					(*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
-					(*v)["s_id"] = ""
-				}
-				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"]
-			}
-		}
-		rela := (*data)["a_relationinfo"]
-		var res []map[string]interface{}
-		if rela != nil {
-			res = util.ObjArrToMapArr((*data)["a_relationinfo"].([]interface{}))
-		}
-		if len(res) > 0 {
-			for _, v := range res {
-				v["s_id"] = ""
-			}
-			m.T["relationinfo"] = res
-		}
-		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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
-			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 && l_remindtime != "" && util.Int64All(l_remindtime) != 0 {
-			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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
-			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["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)
-	myavatar, _ := m.Session().Get("s_avatar").(string)
-	m.T["nickname"] = mynickname
-	m.T["avatar"] = myavatar
-	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-	return m.Render("/weixin/follow/set.html", &m.T)
-}
-func (m *Follow) AllNotice() error {
-	defer util.Catch()
-	id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-	var relationinfo []interface{}
-	fields := `{"_id":-1,"s_title":1,"s_projectcode":1,"s_projectname":1,"s_url":1,"s_id":1,"l_publishtime":1,"a_relationinfo":1,"a_visited":1}`
-	data, ok := mongodb.FindById("follow_project", id, fields)
-	if ok && (data == nil || len(*data) == 0) { //以取消关注
-		data, ok = mongodb.FindOneByField("follow_project_back", `{"s_followid":"`+id+`"}`, fields)
-	}
-	if ok && data != nil {
-		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
-			relationinfo = a_relationinfo.([]interface{})
-			//排序
-			for x, _ := range relationinfo {
-				for y := 0; y < len(relationinfo)-x-1; y++ {
-					dt1 := util.Int64All(relationinfo[y].(map[string]interface{})["l_publishtime"])
-					dt2 := util.Int64All(relationinfo[y+1].(map[string]interface{})["l_publishtime"])
-					if dt1 > 0 && dt2 > 0 && dt1 < dt2 {
-						temp := relationinfo[y]
-						relationinfo[y] = relationinfo[y+1]
-						relationinfo[y+1] = temp
-					}
-				}
-			}
-		}
-		(*data)["a_relationinfo"] = relationinfo
-	}
-	m.ServeJson(map[string]interface{}{
-		"data": data,
-	})
-	return nil
-}
-func (m *Follow) Notice(id, followId string) error {
-	defer util.Catch()
-	query := map[string]interface{}{
-		"_id":      StringTOBsonId(id),
-		"s_userid": util.ObjToString(m.GetSession("userId")),
-	}
-	data, ok := public.MQFW.FindOneByField("jy_pushproject", query, `{"s_followid":-1,"s_title":1,"s_projectcode":1,"s_projectname":1,"a_relationinfo":1,"a_visited":1}`)
-	if ok && data != nil && len(*data) > 0 {
-		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
-			relationinfo := a_relationinfo.([]interface{})
-			for x, _ := range relationinfo {
-				s_id, _ := relationinfo[x].(map[string]interface{})["s_id"].(string)
-				relationinfo[x].(map[string]interface{})["s_id"] = util.EncodeArticleId2ByCheck(s_id)
-				for y := 0; y < len(relationinfo)-x-1; y++ {
-					dt1 := util.Int64All(relationinfo[y].(map[string]interface{})["l_publishtime"])
-					dt2 := util.Int64All(relationinfo[y+1].(map[string]interface{})["l_publishtime"])
-					if dt1 > 0 && dt2 > 0 && dt1 < dt2 {
-						temp := relationinfo[y]
-						relationinfo[y] = relationinfo[y+1]
-						relationinfo[y+1] = temp
-					}
-				}
-			}
-			if len(relationinfo) == 1 {
-				firstMap, _ := relationinfo[0].(map[string]interface{})
-				go public.MQFW.UpdateById("jy_pushproject", id, map[string]interface{}{
-					"$addToSet": map[string]interface{}{"a_visited": firstMap["s_id"]},
-				})
-				return m.Redirect("/article/content/" + util.ObjToString(firstMap["s_id"]) + ".html?advertcode=" + m.GetString("advertcode"))
-			}
-			(*data)["a_relationinfo"] = relationinfo
-		}
-		m.T["data"] = data
-	}
-	m.T["id"] = util.EncodeArticleId2ByCheck(id)
-	m.T["openid"] = se.EncodeString(util.ObjToString(m.GetSession("s_m_openid")))
-	mynickname, _ := m.Session().Get("s_nickname").(string)
-	myavatar, _ := m.Session().Get("s_avatar").(string)
-	m.T["nickname"] = mynickname
-	m.T["avatar"] = myavatar
-	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
-	return m.Render("/weixin/follow/notice.html", &m.T)
-}
-func (m *Follow) Visited() error {
-	defer util.Catch()
-	d_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
-	if d_id == "" {
-		return nil
-	}
-	reqType, _ := m.GetInteger("type")
-	sid := m.GetString("sid")
-	if reqType == 1 {
-		mongodb.UpdateById("follow_project", d_id, map[string]interface{}{
-			"$addToSet": map[string]interface{}{"a_visited": sid},
-		})
-	} else if reqType == 2 {
-		mongodb.UpdateById("jy_pushproject", d_id, map[string]interface{}{
-			"$addToSet": map[string]interface{}{"a_visited": sid},
-		})
-	}
-	return nil
-}
-
-func convertWeekday(weekday string) string {
-	if weekday == "Sunday" {
-		weekday = "日"
-	} else if weekday == "Monday" {
-		weekday = "一"
-	} else if weekday == "Tuesday" {
-		weekday = "二"
-	} else if weekday == "Wednesday" {
-		weekday = "三"
-	} else if weekday == "Thursday" {
-		weekday = "四"
-	} else if weekday == "Friday" {
-		weekday = "五"
-	} else if weekday == "Saturday" {
-		weekday = "六"
-	}
-	return "周" + weekday
-}
-
-//删除redis相关数据
-func delRelRedis(userid interface{}, relationinfo interface{}) {
-	defer util.Catch()
-	uid, _ := userid.(string)
-	if uid == "" || relationinfo == nil {
-		return
-	}
-	array, _ := relationinfo.([]interface{})
-	for _, v := range util.ObjArrToMapArr(array) {
-		sid, _ := v["s_id"].(string)
-		redis.Del("push", "push_"+uid+"_"+sid)
-	}
-}
-
-//拉新获取超级订阅
-func (this *Follow) FollowGift(shareid string) error {
-	defer util.Catch()
-	client := this.Header("User-Agent")
-	bm := mobileReg.MatchString(client)
-	checkIsSubscribeFlag := true
-	openid, _ := this.Session().Get("s_m_openid").(string)
-	nickname, _ := this.Session().Get("s_nickname").(string)
-	redisName := util.ObjToString(config.Sysconfig["shareRedisName"])
-	headImg := ""
-	qrstr := ""
-	infos := ""
-	if !strings.Contains(shareid, "shareId_") {
-		rdata, ok := mongodb.FindOneByField("user", map[string]interface{}{"s_m_openid": shareid, "i_appid": 2}, `{"_id":1}`)
-		if rdata != nil && ok && len(*rdata) > 0 {
-			uid := BsonIdToSId((*rdata)["_id"])
-			infos = redis.GetStr(redisName, fmt.Sprintf("SF_%s", uid))
-		}
-	}
-	if shareUserid := redis.GetStr(redisName, shareid); shareUserid == "" && infos == "" {
-		return this.Render("/_error.html")
-	} else {
-		if infos == "" {
-			infos = redis.GetStr(redisName, fmt.Sprintf("SF_%s", shareUserid))
-		}
-		if infos != "" {
-			nickname = strings.Split(infos, "#@#@")[1]
-			headImg = strings.Split(infos, "#@#@")[2]
-			link := fmt.Sprintf("%s/front/followGift/%s", util.ObjToString(config.Sysconfig["webdomain"]), strings.Split(infos, "#@#@")[3])
-			r, _ := qr.Encode(link, qr.M)
-			pngdat := r.PNG()
-			qrstr = base64.StdEncoding.EncodeToString(pngdat)
-			shareid = strings.Split(infos, "#@#@")[3]
-			if jy.IsPhone(nickname) {
-				nickname = string(nickname[0:3]) + "****" + string(nickname[len(nickname)-4:])
-			}
-		}
-	}
-	if bm {
-		if openid == "" {
-			if this.Session().Get("s_m_openid") == nil {
-				if this.GetString("state") == "wx" {
-					//微信跳回来的
-					code := this.GetString("code")
-					if code != "" {
-						openid = jyutil.Getopenid(code)
-						log.Println("qwe:", openid)
-						if openid != "" {
-							isSubscribe := true
-							if !checkIsSubscribeFlag {
-								checkIsSubscribeFlag = true
-								isSubscribe = CheckUserIsSubscribe(openid)
-							}
-							if isSubscribe {
-								FindUserAndCreateSess(openid, this.Session(), "wx", false)
-							}
-						}
-					}
-				} else {
-					if public.CheckWxBrowser(this.Request) {
-						//所有参数都不再使用,跳到微信验证用户
-						return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
-					}
-				}
-			}
-		}
-		this.T["shareid"] = shareid
-		this.T["share_nickname"] = nickname
-		this.T["share_headImg"] = headImg
-		this.T["openid"] = se.EncodeString(openid)
-		this.T["share_qr"] = qrstr
-		mynickname, _ := this.Session().Get("s_nickname").(string)
-		myavatar, _ := this.Session().Get("s_avatar").(string)
-		this.T["nickname"] = mynickname
-		this.T["avatar"] = myavatar
-		this.T["signature"] = wx.SignJSSDK(this.Site() + this.Url())
-		return this.Render("/frontRouter/wx/share/sess/b-share.html", &this.T)
-	} else {
-		this.T["shareid"] = shareid
-		this.T["share_nickname"] = nickname
-		this.T["share_headImg"] = headImg
-		this.T["signature"] = wx.SignJSSDK(this.Site() + this.Url())
-		this.T["isWeixin"] = public.CheckWxBrowser(this.Request)
-		this.T["share_qr"] = qrstr
-		return this.Render("/frontRouter/pc/share/sess/share-f.html", &this.T)
-	}
-}
+package front
+
+import (
+	"encoding/base64"
+	"errors"
+	"fmt"
+	"jfw/config"
+	"jfw/jyutil"
+	"jfw/public"
+	"jfw/wx"
+	. "mongodb"
+	"net/url"
+	"qfw/util"
+	"qfw/util/elastic"
+	"qfw/util/jy"
+	"qfw/util/redis"
+	"qfw/util/rpc"
+	"strings"
+	"time"
+
+	"github.com/SKatiyar/qr"
+
+	"github.com/go-xweb/xweb"
+	"go.mongodb.org/mongo-driver/bson"
+	"go.mongodb.org/mongo-driver/bson/primitive"
+)
+
+type Follow struct {
+	*xweb.Action
+	ajaxReq        xweb.Mapper `xweb:"/follow/ajaxReq"` //关注项目ajax请求
+	list           xweb.Mapper `xweb:"/follow/list"`    //我关注的项目
+	add            xweb.Mapper `xweb:"/follow/add"`     //添加关注项目
+	addsave        xweb.Mapper `xweb:"/follow/addsave"`
+	set            xweb.Mapper `xweb:"/follow/set/(\\w+)/([^.]*)"`
+	notice         xweb.Mapper `xweb:"/follow/notice/([^.]+)/([^.]*)"` //项目公告
+	allNotice      xweb.Mapper `xweb:"/follow/allNotice"`              //项目公告/(.*)
+	visited        xweb.Mapper `xweb:"/follow/notice/visited"`
+	photo          xweb.Mapper `xweb:"/follow/photo/(.*)"`
+	fwsave         xweb.Mapper `xweb:"/follow/fwsave"`
+	mylist         xweb.Mapper `xweb:"/follow/mylist"`
+	checkFPStatus  xweb.Mapper `xweb:"/follow/checkFPStatus"`
+	checkCStatus   xweb.Mapper `xweb:"/follow/checkCStatus"`
+	shareFW        xweb.Mapper `xweb:"/follow/shareFW/([^.]*)"`
+	pcAllNotice    xweb.Mapper `xweb:"/front/pcAllNotice"`
+	pcEntAllNotice xweb.Mapper `xweb:"/front/pcEntAllNotice"`
+	//分享拉新领取超级订阅
+	followGift xweb.Mapper `xweb:"/front/followGift/(.*)"`
+}
+
+var followLimit int
+
+func init() {
+	xweb.AddAction(&Follow{})
+	followLimit = util.IntAllDef(config.Sysconfig["followProject"], 10)
+}
+
+//
+func (m *Follow) CheckFPStatus() error {
+	defer util.Catch()
+	s_id := util.DecodeArticleId2ByCheck(m.GetString("s_id"))[0]
+	follows, _ := mongodb.FindById("follow_project", s_id, `{"_id":1}`)
+	flag := "f"
+	if follows != nil && *follows != nil && len(*follows) > 0 {
+		flag = "t"
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
+}
+
+//
+func (m *Follow) CheckCStatus() error {
+	defer util.Catch()
+	pname := m.GetString("pcname")
+	pcode := m.GetString("pccode")
+	userId, _ := m.GetSession("userId").(string)
+	openId, _ := m.GetSession("s_m_openid").(string)
+	flag := false
+	followid := ""
+	if userId != "" {
+		flag, followid = MFollow(userId, pname, pcode, "", openId)
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag":     flag,
+		"followid": followid,
+	})
+	return nil
+}
+
+//
+func (m *Follow) Mylist() {
+	defer util.Catch()
+	id := m.GetString("id")
+	id = util.DecodeArticleId2ByCheck(id)[0]
+	var flag = "F"
+	res, ok := mongodb.FindById("follow_project", id, `{"title":1}`)
+	if ok && res != nil && len(*res) > 0 {
+		flag = "T"
+	}
+	m.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+}
+
+//关注列表关注
+func (m *Follow) Fwsave() {
+	defer util.Catch()
+	userId := m.GetSession("userId").(string)
+	openid := m.GetSession("s_m_openid").(string)
+	var status = "n"
+	var followId string
+	s_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
+	if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
+		status = "m"
+	} else if mongodb.Count("follow_project", `{"s_userid":"`+userId+`","s_id":"`+s_id+`"}`) > 0 {
+		status = "e"
+	} else {
+		data := make(map[string]interface{})
+		if remind, _ := m.GetInteger("remind"); remind == 1 {
+			data["i_remind"] = 1
+		} else {
+			data["i_remind"] = 0
+		}
+		if bidopentime, err := m.GetInt("bidopentime"); err == nil {
+			data["l_bidopentime"] = bidopentime
+		}
+		if remindtime, err := m.GetInt("remindtime"); err == nil {
+			data["l_remindtime"] = remindtime
+		}
+		projectname := m.GetString("projectname")
+		data["s_projectname"] = projectname
+		data["s_userid"] = userId
+		data["s_openid"] = openid
+		data["l_createtime"] = time.Now().Unix()
+		data["s_title"] = projectname
+		data["s_id"] = s_id
+		data["i_source"] = 3
+		data["toptype"] = "招标"
+		fields := `"title","comeintime","bidopentime","projectcode","type","href","publishtime","area","subtype","toptype","industry","s_subscopeclass"`
+		res := elastic.GetByIdField("bidding", "bidding", s_id, fields)
+		if res != nil {
+			projectcode, _ := (*res)["projectcode"].(string)
+			data["s_projectcode"] = projectcode
+			data["s_title"] = (*res)["title"]
+			data["s_type"] = (*res)["type"]
+			data["l_publishtime"] = (*res)["publishtime"]
+			data["s_area"] = (*res)["area"]
+			data["s_url"] = (*res)["href"]
+			data["s_province"] = (*res)["area"]
+			data["l_comeintime"] = (*res)["comeintime"]
+			if data["l_bidopentime"] == "" {
+				data["l_bidopentime"] = (*res)["bidopentime"]
+			}
+			mySelf := make(bson.M)
+			mySelf["s_projectname"] = projectname
+			mySelf["s_title"] = (*res)["title"]
+			mySelf["s_projectcode"] = projectcode
+			mySelf["s_url"] = (*res)["href"]
+			mySelf["s_type"] = (*res)["type"]
+			mySelf["s_subtype"] = (*res)["subtype"]
+			mySelf["s_toptype"] = (*res)["toptype"]
+			mySelf["s_province"] = (*res)["area"]
+			mySelf["s_id"] = s_id
+			mySelf["s_eid"] = util.EncodeArticleId2ByCheck(s_id)
+			mySelf["l_publishtime"] = (*res)["publishtime"]
+			if (*res)["industry"] == nil && (*res)["s_subscopeclass"] != nil {
+				ind := strings.Split(util.ObjToString((*res)["s_subscopeclass"]), ",")[0]
+				data["s_industry"] = strings.Split(ind, "_")[0]
+				mySelf["s_industry"] = strings.Split(ind, "_")[0]
+			} else {
+				data["s_industry"] = (*res)["industry"]
+				mySelf["s_industry"] = (*res)["industry"]
+			}
+			data["a_relationinfo"] = []map[string]interface{}{mySelf}
+			if followId = mongodb.Save("follow_project", data); len(followId) > 0 {
+				status = "y"
+				go public.FollowPush(&rpc.FollowPush{
+					ProjectName: projectname,
+					ProjectCode: projectcode,
+					InfoId:      s_id,
+					FollowId:    followId,
+					UserId:      userId,
+				})
+			}
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"status":   status,
+		"followId": util.EncodeArticleId2ByCheck(followId),
+		"infoId":   util.EncodeArticleId2ByCheck(s_id),
+	})
+}
+
+//分享关注项目
+func (m *Follow) ShareFW(tp string) error {
+	defer util.Catch()
+	tpm := strings.Split(tp, "__")
+	id := util.DecodeArticleId2ByCheck(tpm[0])[0]
+	projectname := tpm[1]
+	openid := tpm[2]
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	userId := m.GetSession("userId")
+	if userId != "" && userId != nil {
+		m.T["userId"] = userId.(string)
+	}
+	projectcode := ""
+	m.T["projectname"] = projectname
+	m.T["projectcode"] = projectcode
+	m.T["fg"] = "F"
+	fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area"`
+	data := elastic.GetByIdField("bidding", "bidding", id, fields)
+	bidopentime := (*data)["bidopentime"]
+	if bidopentime != nil && util.Int64All(bidopentime) != 0 {
+		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 && util.Int64All(remindtime) != 0 {
+		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 && util.Int64All(bidopentime) != 0 {
+		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()
+	}
+	mySelf := make(bson.M)
+	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["l_publishtime"] = (*data)["publishtime"]
+	if len(projectname) > 0 {
+		res, _ := public.FollowPush(&rpc.FollowPush{
+			ProjectName: projectname,
+			ProjectCode: projectcode,
+			InfoId:      id,
+			FollowId:    "",
+			UserId:      "",
+			Flag:        1,
+		})
+		if len(res) > 0 || len(mySelf) > 0 {
+			m.T["fg"] = "T"
+			m.T["data"] = res
+			m.T["id"] = id
+			m.T["mySelf"] = mySelf
+			m.T["openid"] = openid
+		}
+	}
+	return m.Render("/weixin/follow/shareset.html", &m.T)
+}
+
+//
+func (m *Follow) PcAllNotice() error {
+	defer util.Catch()
+	id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
+	projectname := m.GetString("projectname")
+	projectcode := m.GetString("projectcode")
+	data := map[string]interface{}{}
+	if len(projectname) > 0 || len(projectcode) > 0 {
+		res, _ := public.FollowPush(&rpc.FollowPush{
+			ProjectName: projectname,
+			ProjectCode: projectcode,
+			InfoId:      id,
+			FollowId:    "",
+			UserId:      "",
+			Flag:        1,
+		})
+		if len(res) > 0 {
+			for _, v := range res {
+				(*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
+			}
+			data["res"] = res
+		}
+	}
+
+	m.ServeJson(map[string]interface{}{
+		"data": data,
+	})
+	return nil
+}
+
+//中标企业公告列表
+func (m *Follow) PcEntAllNotice() error {
+	defer util.Catch()
+	entname := m.GetString("entname")
+	data := map[string]interface{}{}
+	if entname != "" {
+		entname_a := strings.Split(entname, ",")
+		for _, v := range entname_a {
+			if v != "" {
+				fields := `"_id","projectname","bidamount","title","publishtime","subtype","toptype","href"`
+				res := elastic.GetPage("bidding", "bidding", `{"TERM_s_winner":"`+v+`"}`, `{"publishtime":-1}`, fields, 0, 100)
+				if len(*res) != 0 && res != nil && *res != nil {
+					for _, v := range *res {
+						v["_id"] = util.EncodeArticleId2ByCheck(BsonIdToSId(v["_id"]))
+					}
+					data[v] = res
+				}
+			}
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"data": data,
+	})
+	return nil
+}
+
+//未关注项目
+func (m *Follow) Photo(tp string) error {
+	defer util.Catch()
+	followid := ""
+	tpm := strings.Split(tp, "__")
+	projectname := tpm[1]
+	projectcode := tpm[2]
+	userid, _ := m.GetSession("userId").(string)
+	openid := m.GetSession("s_m_openid").(string)
+	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}`
+		_id, _ := primitive.ObjectIDFromHex(id)
+		data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
+			"_id":      _id,
+			"s_userid": userid,
+		}, 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
+		}
+		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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
+			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 && l_remindtime != "" && util.Int64All(l_remindtime) != 0 {
+			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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
+			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()
+		}
+	} 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","industry","s_subscopeclass"`
+		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"]
+			if (*data)["industry"] == nil && (*data)["s_subscopeclass"] != nil {
+				ind := strings.Split(util.ObjToString((*data)["s_subscopeclass"]), ",")[0]
+				(*data)["industry"] = strings.Split(ind, "_")[0]
+				mySelf["s_industry"] = strings.Split(ind, "_")[0]
+			}
+			////////////////////////
+			bidopentime := (*data)["bidopentime"]
+			if bidopentime != nil && bidopentime != "" && util.Int64All(bidopentime) != 0 {
+				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 && remindtime != "" && util.Int64All(remindtime) != 0 {
+				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 && bidopentime != "" && util.Int64All(bidopentime) != 0 {
+				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, _ := public.FollowPush(&rpc.FollowPush{
+				ProjectName: projectname,
+				ProjectCode: projectcode,
+				InfoId:      id,
+				FollowId:    "",
+				UserId:      m.GetSession("userId").(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
+	}
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	m.T["openid"] = se.EncodeString(myopenid)
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	return m.Render("/weixin/follow/set.html", &m.T)
+}
+
+//关注项目相关的ajax请求
+func (m *Follow) AjaxReq() {
+	defer util.Catch()
+	userId := m.GetSession("userId").(string)
+	openid := m.GetSession("s_m_openid").(string)
+	var status = "n"
+	reqType := m.GetString("reqType")
+	var followId string
+	if reqType == "follow" { //快照页面关注
+		s_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
+		if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
+			status = "m"
+		} else if mongodb.Count("follow_project", `{"s_userid":"`+userId+`","s_id":"`+s_id+`"}`) > 0 {
+			status = "e"
+		} else {
+			publishtime, _ := m.GetInt("publishtime")
+			projectname := m.GetString("projectname")
+			projectcode := m.GetString("projectcode")
+			url := m.GetString("url")
+			title := m.GetString("title")
+			area := m.GetString("area")
+			subtype := m.GetString("subtype")
+			toptype := m.GetString("toptype")
+			s_type := m.GetString("type")
+			s_industry := m.GetString("industry")
+			if projectname != "" || projectcode != "" {
+				data := map[string]interface{}{
+					"s_userid":      userId,
+					"s_openid":      openid,
+					"s_id":          s_id,
+					"s_url":         url,
+					"s_title":       title,
+					"l_createtime":  time.Now().Unix(),
+					"i_remind":      0,
+					"l_publishtime": publishtime,
+					"i_source":      1,
+					"s_province":    area,
+					"s_area":        area,
+					"s_type":        s_type,
+					"s_industry":    s_industry,
+					"toptype":       "招标",
+				}
+				if comeintime, err := m.GetInt("comeintime"); err == nil {
+					data["l_comeintime"] = comeintime
+				}
+				if s_type := m.GetString("type"); s_type != "" {
+					data["s_type"] = s_type
+				}
+				if projectname != "" {
+					data["s_projectname"] = projectname
+				} else {
+					data["s_projectname"] = title
+				}
+				if projectcode != "" {
+					data["s_projectcode"] = projectcode
+				}
+				if bidopentime, err := m.GetInt("bidopentime"); err == nil && bidopentime > 0 {
+					data["l_bidopentime"] = bidopentime
+				}
+				//
+				mySelf := make(bson.M)
+				mySelf["s_projectcode"] = projectcode
+				mySelf["s_projectname"] = projectname
+				mySelf["s_title"] = title
+				mySelf["s_url"] = url
+				mySelf["s_id"] = s_id
+				mySelf["s_eid"] = util.EncodeArticleId2ByCheck(s_id)
+				mySelf["l_publishtime"] = publishtime
+				mySelf["s_province"] = area
+				mySelf["s_subtype"] = subtype
+				mySelf["s_toptype"] = toptype
+				mySelf["s_type"] = s_type
+				mySelf["s_industry"] = s_industry
+				//
+				data["a_relationinfo"] = []map[string]interface{}{mySelf}
+				if followId = mongodb.Save("follow_project", data); len(followId) > 0 {
+					status = "y"
+					go public.FollowPush(&rpc.FollowPush{
+						ProjectName: projectname,
+						ProjectCode: projectcode,
+						InfoId:      s_id,
+						FollowId:    followId,
+						UserId:      userId,
+					})
+				}
+			}
+		}
+	} else if reqType == "cancel" { //取消关注
+		if data, ok := mongodb.FindOne("follow_project", `{"s_userid":"`+userId+`","_id":"`+util.DecodeArticleId2ByCheck(m.GetString("id"))[0]+`"}`); ok && data != nil {
+			(*data)["s_followid"] = BsonIdToSId((*data)["_id"])
+			delete(*data, "_id")
+			(*data)["i_status"] = 1
+			mongodb.Save("follow_project_back", data)
+			if mongodb.Del("follow_project", `{"s_userid":"`+(*data)["s_userid"].(string)+`","_id":"`+util.DecodeArticleId2ByCheck(m.GetString("id"))[0]+`"}`) {
+				status = "y"
+				go delRelRedis((*data)["s_userid"], (*data)["a_relationinfo"])
+			}
+		}
+	} else if reqType == "followset" {
+		id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
+		_id, _ := primitive.ObjectIDFromHex(id)
+		if mongodb.Count("follow_project", map[string]interface{}{"_id": _id, "s_userid": userId}) == 1 {
+			data := make(map[string]interface{})
+			data["l_updatetime"] = time.Now().Unix()
+			if remind, _ := m.GetInteger("remind"); remind == 1 {
+				data["i_remind"] = 1
+			} else {
+				data["i_remind"] = 0
+			}
+			if bidopentime, err := m.GetInt("bidopentime"); err == nil {
+				data["l_bidopentime"] = bidopentime
+			}
+			if remindtime, err := m.GetInt("remindtime"); err == nil {
+				data["l_remindtime"] = remindtime
+			}
+			if mongodb.Update("follow_project", `{"_id":"`+id+`"}`, map[string]interface{}{"$set": data}, false, false) {
+				status = "y"
+			}
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"status":   status,
+		"followId": util.EncodeArticleId2ByCheck(followId),
+	})
+}
+
+//我关注的项目
+func (m *Follow) List() error {
+	defer util.Catch()
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	userId := util.ObjToString(m.Session().Get("userId"))
+	if userId == "" {
+		return errors.New("查询我关注的项目出错,userid为空")
+	}
+	datas, ok := mongodb.Find("follow_project", `{"s_userid":"`+userId+`"}`, `{"l_lastpushtime":-1,"l_createtime":-1}`, `{"s_projectname":1,"s_projectcode":1,"i_remind":1,"l_lastpushtime":1,"l_createtime":1,"s_industry":1,"s_area":1}`, false, -1, -1)
+	m.T["flag"] = false
+	if ok && datas != nil && len(*datas) > 0 {
+		for _, v := range *datas {
+			v["_id"] = util.EncodeArticleId2ByCheck(BsonIdToSId(v["_id"]))
+			if v["l_lastpushtime"] == "" || v["l_lastpushtime"] == nil {
+				v["l_lastpushtime"] = v["l_createtime"]
+			}
+		}
+		m.T["datas"] = datas
+		if len(*datas) >= followLimit {
+			m.T["flag"] = true
+		}
+	}
+	m.T["openid"] = se.EncodeString(myopenid)
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	m.T["followLimit"] = followLimit
+	return m.Render("/weixin/follow/list.html", &m.T)
+}
+
+//添加关注项目
+func (m *Follow) Add() error {
+	myopenid, _ := m.Session().Get("s_m_openid").(string)
+	m.T["openid"] = se.EncodeString(myopenid)
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	return m.Render("/weixin/follow/add.html", &m.T)
+}
+
+//手动添加关注项目
+func (m *Follow) Addsave() error {
+	defer util.Catch()
+	var status = "n"
+	var id string
+	userId := m.GetSession("userId").(string)
+	openid := m.GetSession("s_m_openid").(string)
+	if mongodb.Count("follow_project", `{"s_userid":"`+userId+`"}`) >= followLimit {
+		status = "m"
+	} else {
+		if projectname := m.GetString("projectname"); projectname != "" {
+			data := map[string]interface{}{
+				"s_userid":      userId,
+				"s_openid":      openid,
+				"s_projectname": projectname,
+				"l_createtime":  time.Now().Unix(),
+				"i_remind":      0,
+				"s_title":       projectname,
+				"i_source":      2,
+				"toptype":       "招标",
+			}
+			//匹配
+			r := elastic.GetPage("bidding", "bidding", `{"TERM_projectname":"`+projectname+`"}`, `{"comeintime":-1}`, `"_id","title","comeintime","bidopentime","projectcode","type","href","publishtime","subtype","toptype","area","industry","s_subscopeclass"`, -1, -1)
+			var matchingFlag = r != nil && len(*r) != 0
+			var projectcode, sid string
+			if matchingFlag {
+				d := (*r)[0]
+				sid = d["_id"].(string) //(d["_id"].(bson.ObjectId)).Hex()
+				data["s_id"] = sid
+				data["l_comeintime"] = d["comeintime"]
+				publishtime := d["publishtime"]
+				data["l_publishtime"] = publishtime
+				data["s_title"] = d["title"]
+				data["s_area"] = d["area"]
+				data["s_province"] = d["area"]
+				if bidopentime := d["bidopentime"]; bidopentime != nil && util.Int64All(bidopentime) != 0 {
+					data["l_bidopentime"] = bidopentime
+				}
+				if d["projectcode"] != nil {
+					projectcode = d["projectcode"].(string)
+					data["s_projectcode"] = projectcode
+				}
+				if s_type := d["type"]; s_type != nil {
+					data["s_type"] = s_type
+				}
+				url := d["href"].(string)
+				data["s_url"] = url
+				//
+				mySelf := make(bson.M)
+				mySelf["s_type"] = util.ObjToString(d["type"])
+				mySelf["s_toptype"] = util.ObjToString(d["toptype"])
+				mySelf["s_subtype"] = util.ObjToString(d["subtype"])
+				mySelf["s_province"] = util.ObjToString(d["area"])
+				mySelf["s_projectname"] = projectname
+				mySelf["s_title"] = d["title"]
+				mySelf["s_projectcode"] = projectcode
+				mySelf["s_url"] = url
+				mySelf["s_id"] = sid
+				mySelf["s_eid"] = util.EncodeArticleId2ByCheck(sid)
+				mySelf["l_publishtime"] = publishtime
+				if d["industry"] == nil && d["s_subscopeclass"] != nil {
+					ind := strings.Split(util.ObjToString(d["s_subscopeclass"]), ",")[0]
+					data["s_industry"] = strings.Split(ind, "_")[0]
+					mySelf["s_industry"] = strings.Split(ind, "_")[0]
+				} else {
+					data["s_industry"] = d["industry"]
+					mySelf["s_industry"] = d["industry"]
+				}
+				data["a_relationinfo"] = []map[string]interface{}{mySelf}
+			}
+			if id = mongodb.Save("follow_project", data); len(id) > 0 {
+				status = "y"
+				go public.FollowPush(&rpc.FollowPush{
+					ProjectName: projectname,
+					ProjectCode: projectcode,
+					InfoId:      sid,
+					FollowId:    id,
+					UserId:      userId,
+				})
+			}
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"status": status,
+		"id":     util.EncodeArticleId2ByCheck(id),
+	})
+	return nil
+}
+func (m *Follow) Set(tp, id string) error {
+	defer util.Catch()
+	isDel := false
+	id = util.DecodeArticleId2ByCheck(id)[0]
+	userid := util.ObjToString(m.GetSession("userId"))
+	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,"s_userid":1}`
+	_id, _ := primitive.ObjectIDFromHex(id)
+	data, ok := mongodb.FindOneByField("follow_project", map[string]interface{}{
+		"_id": _id,
+	}, fields)
+	if ok && (data == nil || len(*data) == 0) {
+		data, ok = mongodb.FindOneByField("follow_project_back", `{"s_followid":"`+id+`"}`, fields)
+		isDel = true
+	}
+	if !ok || data == nil || len(*data) == 0 {
+		return m.Render("_error.html")
+	}
+	sid, _ := (*data)["s_id"].(string)
+	projectname, _ := (*data)["s_projectname"].(string)
+	projectcode, _ := (*data)["s_projectcode"].(string)
+	if util.ObjToString((*data)["s_userid"]) != userid {
+		return m.Redirect(fmt.Sprintf("/follow/photo/%s__%s__%s", util.EncodeArticleId2ByCheck(sid), projectname, projectcode))
+	}
+	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 && bidopentime != "" && util.Int64All(bidopentime) != 0 {
+				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 && remindtime != "" && util.Int64All(remindtime) != 0 {
+				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 && bidopentime != "" && util.Int64All(bidopentime) != 0 {
+				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, _ := public.FollowPush(&rpc.FollowPush{
+				ProjectName: projectname,
+				ProjectCode: projectcode,
+				InfoId:      sid,
+				FollowId:    "",
+				UserId:      m.GetSession("userId").(string),
+				Flag:        1,
+			})
+			if len(res) > 0 || len(mySelf) > 0 {
+				for _, v := range res {
+					(*v)["s_eid"] = util.EncodeArticleId2ByCheck((*v)["s_id"].(string))
+					(*v)["s_id"] = ""
+				}
+				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"]
+			}
+		}
+		rela := (*data)["a_relationinfo"]
+		var res []map[string]interface{}
+		if rela != nil {
+			res = util.ObjArrToMapArr((*data)["a_relationinfo"].([]interface{}))
+		}
+		if len(res) > 0 {
+			for _, v := range res {
+				v["s_id"] = ""
+			}
+			m.T["relationinfo"] = res
+		}
+		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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
+			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 && l_remindtime != "" && util.Int64All(l_remindtime) != 0 {
+			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 && l_bidopentime != "" && util.Int64All(l_bidopentime) != 0 {
+			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["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)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	return m.Render("/weixin/follow/set.html", &m.T)
+}
+func (m *Follow) AllNotice() error {
+	defer util.Catch()
+	id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
+	var relationinfo []interface{}
+	fields := `{"_id":-1,"s_title":1,"s_projectcode":1,"s_projectname":1,"s_url":1,"s_id":1,"l_publishtime":1,"a_relationinfo":1,"a_visited":1}`
+	data, ok := mongodb.FindById("follow_project", id, fields)
+	if ok && (data == nil || len(*data) == 0) { //以取消关注
+		data, ok = mongodb.FindOneByField("follow_project_back", `{"s_followid":"`+id+`"}`, fields)
+	}
+	if ok && data != nil {
+		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
+			relationinfo = a_relationinfo.([]interface{})
+			//排序
+			for x := range relationinfo {
+				for y := 0; y < len(relationinfo)-x-1; y++ {
+					dt1 := util.Int64All(relationinfo[y].(map[string]interface{})["l_publishtime"])
+					dt2 := util.Int64All(relationinfo[y+1].(map[string]interface{})["l_publishtime"])
+					if dt1 > 0 && dt2 > 0 && dt1 < dt2 {
+						temp := relationinfo[y]
+						relationinfo[y] = relationinfo[y+1]
+						relationinfo[y+1] = temp
+					}
+				}
+			}
+		}
+		(*data)["a_relationinfo"] = relationinfo
+	}
+	m.ServeJson(map[string]interface{}{
+		"data": data,
+	})
+	return nil
+}
+func (m *Follow) Notice(id, followId string) error {
+	defer util.Catch()
+	query := map[string]interface{}{
+		"_id":      StringTOBsonId(id),
+		"s_userid": util.ObjToString(m.GetSession("userId")),
+	}
+	data, ok := public.MQFW.FindOneByField("jy_pushproject", query, `{"s_followid":-1,"s_title":1,"s_projectcode":1,"s_projectname":1,"a_relationinfo":1,"a_visited":1}`)
+	if ok && data != nil && len(*data) > 0 {
+		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
+			relationinfo := a_relationinfo.([]interface{})
+			for x := range relationinfo {
+				s_id, _ := relationinfo[x].(map[string]interface{})["s_id"].(string)
+				relationinfo[x].(map[string]interface{})["s_id"] = util.EncodeArticleId2ByCheck(s_id)
+				for y := 0; y < len(relationinfo)-x-1; y++ {
+					dt1 := util.Int64All(relationinfo[y].(map[string]interface{})["l_publishtime"])
+					dt2 := util.Int64All(relationinfo[y+1].(map[string]interface{})["l_publishtime"])
+					if dt1 > 0 && dt2 > 0 && dt1 < dt2 {
+						temp := relationinfo[y]
+						relationinfo[y] = relationinfo[y+1]
+						relationinfo[y+1] = temp
+					}
+				}
+			}
+			if len(relationinfo) == 1 {
+				firstMap, _ := relationinfo[0].(map[string]interface{})
+				go public.MQFW.UpdateById("jy_pushproject", id, map[string]interface{}{
+					"$addToSet": map[string]interface{}{"a_visited": firstMap["s_id"]},
+				})
+				return m.Redirect("/article/content/" + util.ObjToString(firstMap["s_id"]) + ".html?advertcode=" + m.GetString("advertcode"))
+			}
+			(*data)["a_relationinfo"] = relationinfo
+		}
+		m.T["data"] = data
+	}
+	m.T["id"] = util.EncodeArticleId2ByCheck(id)
+	m.T["openid"] = se.EncodeString(util.ObjToString(m.GetSession("s_m_openid")))
+	mynickname, _ := m.Session().Get("s_nickname").(string)
+	myavatar, _ := m.Session().Get("s_avatar").(string)
+	m.T["nickname"] = mynickname
+	m.T["avatar"] = myavatar
+	m.T["signature"] = wx.SignJSSDK(m.Site() + m.Url())
+	return m.Render("/weixin/follow/notice.html", &m.T)
+}
+func (m *Follow) Visited() error {
+	defer util.Catch()
+	d_id := util.DecodeArticleId2ByCheck(m.GetString("id"))[0]
+	if d_id == "" {
+		return nil
+	}
+	reqType, _ := m.GetInteger("type")
+	sid := m.GetString("sid")
+	if reqType == 1 {
+		mongodb.UpdateById("follow_project", d_id, map[string]interface{}{
+			"$addToSet": map[string]interface{}{"a_visited": sid},
+		})
+	} else if reqType == 2 {
+		mongodb.UpdateById("jy_pushproject", d_id, map[string]interface{}{
+			"$addToSet": map[string]interface{}{"a_visited": sid},
+		})
+	}
+	return nil
+}
+
+func convertWeekday(weekday string) string {
+	if weekday == "Sunday" {
+		weekday = "日"
+	} else if weekday == "Monday" {
+		weekday = "一"
+	} else if weekday == "Tuesday" {
+		weekday = "二"
+	} else if weekday == "Wednesday" {
+		weekday = "三"
+	} else if weekday == "Thursday" {
+		weekday = "四"
+	} else if weekday == "Friday" {
+		weekday = "五"
+	} else if weekday == "Saturday" {
+		weekday = "六"
+	}
+	return "周" + weekday
+}
+
+//删除redis相关数据
+func delRelRedis(userid interface{}, relationinfo interface{}) {
+	defer util.Catch()
+	uid, _ := userid.(string)
+	if uid == "" || relationinfo == nil {
+		return
+	}
+	array, _ := relationinfo.([]interface{})
+	for _, v := range util.ObjArrToMapArr(array) {
+		sid, _ := v["s_id"].(string)
+		redis.Del("push", "push_"+uid+"_"+sid)
+	}
+}
+
+//拉新获取超级订阅
+func (this *Follow) FollowGift(shareid string) error {
+	defer util.Catch()
+	client := this.Header("User-Agent")
+	bm := mobileReg.MatchString(client)
+	openid, _ := this.Session().Get("s_m_openid").(string)
+	nickname, _ := this.Session().Get("s_nickname").(string)
+	redisName := util.ObjToString(config.Sysconfig["shareRedisName"])
+	headImg := ""
+	qrstr := ""
+	infos := ""
+	if !strings.Contains(shareid, "shareId_") {
+		rdata, ok := mongodb.FindOneByField("user", map[string]interface{}{"s_m_openid": shareid, "i_appid": 2}, `{"_id":1}`)
+		if rdata != nil && ok && len(*rdata) > 0 {
+			uid := BsonIdToSId((*rdata)["_id"])
+			infos = redis.GetStr(redisName, fmt.Sprintf("SF_%s", uid))
+		}
+	}
+	if shareUserid := redis.GetStr(redisName, shareid); shareUserid == "" && infos == "" {
+		return this.Render("/_error.html")
+	} else {
+		if infos == "" {
+			infos = redis.GetStr(redisName, fmt.Sprintf("SF_%s", shareUserid))
+		}
+		if infos != "" {
+			nickname = strings.Split(infos, "#@#@")[1]
+			headImg = strings.Split(infos, "#@#@")[2]
+			link := fmt.Sprintf("%s/front/followGift/%s", util.ObjToString(config.Sysconfig["webdomain"]), strings.Split(infos, "#@#@")[3])
+			r, _ := qr.Encode(link, qr.M)
+			pngdat := r.PNG()
+			qrstr = base64.StdEncoding.EncodeToString(pngdat)
+			shareid = strings.Split(infos, "#@#@")[3]
+			if jy.IsPhone(nickname) {
+				nickname = string(nickname[0:3]) + "****" + string(nickname[len(nickname)-4:])
+			}
+		}
+	}
+	if bm {
+		if openid == "" {
+			if this.Session().Get("s_m_openid") == nil {
+				if this.GetString("state") == "wx" {
+					//微信跳回来的
+					code := this.GetString("code")
+					if code != "" {
+						openid = jyutil.Getopenid(code)
+						if openid != "" {
+							if CheckUserIsSubscribe(openid) {
+								FindUserAndCreateSess(openid, this.Session(), "wx", false)
+							}
+						}
+					}
+				} else {
+					if public.CheckWxBrowser(this.Request) {
+						//所有参数都不再使用,跳到微信验证用户
+						return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
+					}
+				}
+			}
+		}
+		this.T["shareid"] = shareid
+		this.T["share_nickname"] = nickname
+		this.T["share_headImg"] = headImg
+		this.T["openid"] = se.EncodeString(openid)
+		this.T["share_qr"] = qrstr
+		mynickname, _ := this.Session().Get("s_nickname").(string)
+		myavatar, _ := this.Session().Get("s_avatar").(string)
+		this.T["nickname"] = mynickname
+		this.T["avatar"] = myavatar
+		this.T["signature"] = wx.SignJSSDK(this.Site() + this.Url())
+		return this.Render("/frontRouter/wx/share/sess/b-share.html", &this.T)
+	} else {
+		this.T["shareid"] = shareid
+		this.T["share_nickname"] = nickname
+		this.T["share_headImg"] = headImg
+		this.T["signature"] = wx.SignJSSDK(this.Site() + this.Url())
+		this.T["isWeixin"] = public.CheckWxBrowser(this.Request)
+		this.T["share_qr"] = qrstr
+		return this.Render("/frontRouter/pc/share/sess/share-f.html", &this.T)
+	}
+}

+ 40 - 103
src/jfw/front/front.go

@@ -29,15 +29,8 @@ import (
 	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
-type userPool struct {
-	lock    sync.Mutex
-	openIds []string
-	user    map[string]*map[string]interface{}
-}
 type Front struct {
 	*xweb.Action
-	test xweb.Mapper `xweb:"/front/test"`
-
 	ajaxPolling        xweb.Mapper `xweb:"/front/ajaxPolling"`      //登录轮询
 	getLoginNum        xweb.Mapper `xweb:"/front/getLoginNum/(.*)"` //
 	login              xweb.Mapper `xweb:"/front/login/(.*)"`       //登录
@@ -60,37 +53,32 @@ type Front struct {
 	wxpushListInfo     xweb.Mapper `xweb:"/wxpush/bidinfo/(.*)"`  //推送列表
 	feedback           xweb.Mapper `xweb:"/swordfish/feedback"`   //意见反馈
 	wxpushAjaxReq      xweb.Mapper `xweb:"/wxpush/bid/ajaxReq"`
-	/*
-		newSordfish        xweb.Mapper `xweb:"/"`                                  //剑鱼标讯pc首页
-		newSordfishC       xweb.Mapper `xweb:"/pcindex.html"`                      //剑鱼标讯pc首页-统计
-	*/
-	searchinfolist    xweb.Mapper `xweb:"/swordfish/searchinfolist(.*).html"` //剑鱼标讯pc查询
-	about             xweb.Mapper `xweb:"/swordfish/about"`
-	shareabout        xweb.Mapper `xweb:"/swordfish/shareabout/([^.]*)"`
-	getIndexData      xweb.Mapper `xweb:"/front/index.*"`
-	urlrecord         xweb.Mapper `xweb:"/front/urlrecord.*"`
-	isrecord          xweb.Mapper `xweb:"/front/isrecord/(.*)"`
-	praise            xweb.Mapper `xweb:"/swordfish/praise"`
-	aboutsearch       xweb.Mapper `xweb:"/swordfish/aboutsearch"`
-	aboutSR           xweb.Mapper `xweb:"/swordfish/aboutsearchresult"`
-	delOL             xweb.Mapper `xweb:"/swordfish/delovertimelist"` //手动删除30天无更新数据
-	pcAjaxReq         xweb.Mapper `xweb:"/front/pcAjaxReq"`
-	myFeedbacks       xweb.Mapper `xweb:"/swordfish/myFeedbacks"`
-	wxerr             xweb.Mapper `xweb:"/mob/err"`
-	getRecomKWs       xweb.Mapper `xweb:"/member/getRecomKWs"`           //获取推荐关键词
-	behaviorRecord    xweb.Mapper `xweb:"/member/behaviorRecord"`        //记录用户点击的关键词
-	tSGuide           xweb.Mapper `xweb:"/front/tenderSubscribe/guide"`  //引导页
-	transfer          xweb.Mapper `xweb:"/front/transfer"`               //原文链接中转
-	jyblog            xweb.Mapper `xweb:"/jyblog/index([^.]*).html"`     //剑鱼标讯博客
-	jybdetail         xweb.Mapper `xweb:"/jyblog/([^.]*).html"`          //剑鱼标讯博客三级页
-	blogpraise        xweb.Mapper `xweb:"/jyblog/blogpraise"`            //剑鱼标讯博客三级页点赞
-	encrypt           xweb.Mapper `xweb:"/share/encrypt"`                //分享三级页加密
-	newhistorypush    xweb.Mapper `xweb:"/swordfish/newhistorypush"`     //新的历时推送记录
-	historypush       xweb.Mapper `xweb:"/swordfish/historypush"`        //历时推送记录
-	historypushPaging xweb.Mapper `xweb:"/swordfish/historypush/paging"` //历时推送记录--分页
-	aboutus           xweb.Mapper `xweb:"/front/aboutus.html"`           //关于我们
-	busicooperation   xweb.Mapper `xweb:"/front/busicooperation.html"`   //商务合作
-	//bidsearchforent	  xweb.Mapper `xweb:"/front/bidsearchforent.html"`   //中标企业搜索
+	searchinfolist     xweb.Mapper `xweb:"/swordfish/searchinfolist(.*).html"` //剑鱼标讯pc查询
+	about              xweb.Mapper `xweb:"/swordfish/about"`
+	shareabout         xweb.Mapper `xweb:"/swordfish/shareabout/([^.]*)"`
+	getIndexData       xweb.Mapper `xweb:"/front/index.*"`
+	urlrecord          xweb.Mapper `xweb:"/front/urlrecord.*"`
+	isrecord           xweb.Mapper `xweb:"/front/isrecord/(.*)"`
+	praise             xweb.Mapper `xweb:"/swordfish/praise"`
+	aboutsearch        xweb.Mapper `xweb:"/swordfish/aboutsearch"`
+	aboutSR            xweb.Mapper `xweb:"/swordfish/aboutsearchresult"`
+	delOL              xweb.Mapper `xweb:"/swordfish/delovertimelist"` //手动删除30天无更新数据
+	pcAjaxReq          xweb.Mapper `xweb:"/front/pcAjaxReq"`
+	myFeedbacks        xweb.Mapper `xweb:"/swordfish/myFeedbacks"`
+	wxerr              xweb.Mapper `xweb:"/mob/err"`
+	getRecomKWs        xweb.Mapper `xweb:"/member/getRecomKWs"`           //获取推荐关键词
+	behaviorRecord     xweb.Mapper `xweb:"/member/behaviorRecord"`        //记录用户点击的关键词
+	tSGuide            xweb.Mapper `xweb:"/front/tenderSubscribe/guide"`  //引导页
+	transfer           xweb.Mapper `xweb:"/front/transfer"`               //原文链接中转
+	jyblog             xweb.Mapper `xweb:"/jyblog/index([^.]*).html"`     //剑鱼标讯博客
+	jybdetail          xweb.Mapper `xweb:"/jyblog/([^.]*).html"`          //剑鱼标讯博客三级页
+	blogpraise         xweb.Mapper `xweb:"/jyblog/blogpraise"`            //剑鱼标讯博客三级页点赞
+	encrypt            xweb.Mapper `xweb:"/share/encrypt"`                //分享三级页加密
+	newhistorypush     xweb.Mapper `xweb:"/swordfish/newhistorypush"`     //新的历时推送记录
+	historypush        xweb.Mapper `xweb:"/swordfish/historypush"`        //历时推送记录
+	historypushPaging  xweb.Mapper `xweb:"/swordfish/historypush/paging"` //历时推送记录--分页
+	aboutus            xweb.Mapper `xweb:"/front/aboutus.html"`           //关于我们
+	busicooperation    xweb.Mapper `xweb:"/front/busicooperation.html"`   //商务合作
 
 	/********************wxkeyset:v1.8**************************/
 	wxKeysetAjaxReq xweb.Mapper `xweb:"/wxkeyset/ajaxReq"`           //订阅词ajax请求
@@ -158,8 +146,6 @@ var sewx util.SimpleEncrypt //微信的加密方法
 var mongodb = public.MQFW
 var urlMap map[string]interface{}
 
-//var userPoolSize = 1000
-//var up userPool
 var se = util.SE //移到tools中
 var isIosReg = regexp.MustCompile("\\(i[^;]+;( U;)? CPU.+Mac OS X")
 
@@ -168,8 +154,6 @@ func init() {
 	xweb.AddAction(&Front{})
 	xweb.AddAction(&Short{})
 	urlMap = config.Sysconfig["redirect"].(map[string]interface{})
-	//userPoolSize = util.IntAllDef(config.Sysconfig["userPoolSize"], userPoolSize)
-	//up.user = make(map[string]*map[string]interface{})
 }
 
 //前端页面加载
@@ -184,13 +168,9 @@ func (this *Front) RewardText() {
 	this.Write(rewardText)
 	return
 }
-func (f *Front) Test() error {
-	return f.Render("/test.html")
-}
 
 //
 func (f *Front) Hp() error {
-
 	return f.Redirect("/")
 }
 
@@ -278,7 +258,7 @@ func (f *Front) RecInof() error {
 			var fdone = fields[0]
 			var fdtwo = fields[1]
 			if strings.Contains(fdone, "winnerorder") {
-				fdone = fdone[len(fdone)-1 : len(fdone)]
+				fdone = fdone[len(fdone)-1:]
 				data["s_field"] = "winnerorder." + fdone + "." + fdtwo //纠错字段
 			} else {
 				data["s_field"] = "package." + fdone + "." + fdtwo //纠错字段
@@ -293,10 +273,7 @@ func (f *Front) RecInof() error {
 		data["s_aftercont"] = reccont
 		data["s_id"] = id                          //纠错文章id
 		data["l_recoverydate"] = time.Now().Unix() //纠错时间
-		rrid := mongodb.Save("recoveryrecord", data)
-		if len(rrid) > 0 {
-			//log.Println("用户纠错记录保存成功!")
-		}
+		_ = mongodb.Save("recoveryrecord", data)
 		brobj, ok := mongodb.Find("bidding_rec", bson.M{"s_id": id}, `{"l_recoverydate":-1}`, nil, false, 0, 1)
 		if ok && (*brobj) != nil && len(*brobj) == 1 && (*brobj)[0] != nil {
 			obj = (*brobj)[0]
@@ -322,7 +299,7 @@ func (f *Front) RecInof() error {
 				var fdtwo = fields[1]
 				if strings.Contains(fdone, "winnerorder") {
 					var winnerorderArr = obj["winnerorder"].([]interface{})
-					fdone = fdone[len(fdone)-1 : len(fdone)]
+					fdone = fdone[len(fdone)-1:]
 					kk, _ := strconv.Atoi(fdone)
 					if len(winnerorderArr) > 0 {
 						for k, v := range winnerorderArr {
@@ -673,7 +650,7 @@ func (f *Front) GetLoginNum(prestr string) error {
 	var Rref = f.GetString("rref")
 	f.SetSession("Rref", Rref)
 	shareid, shareidot := qrmanager.QrCodeManager.GetQRCode(oid, prestr, f.Session(), f.Request)
-	//log.Println("登录获取shareid:", shareid)
+
 	if prestr == config.Seoconfig["jydyy"].(string) { //订阅页面扫码回复信息
 		redis.Put("sso", "pc_subscribe_reply_"+shareidot, "1", 15*60)
 	}
@@ -688,13 +665,9 @@ func (f *Front) GetLoginNum(prestr string) error {
 func (m *Front) Onekey() error {
 	defer util.Catch()
 	fkid := util.DecodeArticleId2ByCheck(m.GetString("fkid"))[0]
-	//onekeyid := redis.Get("other", "onekey_"+fkid)
 	flag := "N"
 	data := make(map[string]interface{})
-	//if onekeyid == nil {
 	if fkid != "" {
-		//intdata, _ := mongodb.FindOne("interaction", `{"s_fkid":"`+fkid+`","i_type":7}`)
-		//if len(*intdata) == 0 {
 		userId, _ := m.GetSession("userId").(string)
 		if userId != "" {
 			userInfo, _ := mongodb.FindById("user", userId, nil)
@@ -740,21 +713,8 @@ func (m *Front) Onekey() error {
 		if len(id) > 0 {
 			flag = "Y"
 		}
-		//} else if (*intdata)["i_status"] == 1 {
-		//			set := make(map[string]interface{})
-		//			set["i_status"] = 0
-		//			set["s_opinion"] = ""
-		//			set["s_auditname"] = ""
-		//			set["s_editorname"] = ""
-		//			set["l_submitdate"] = time.Now().Unix()
-		//			id := mongodb.Update("interaction", `{"s_fkid":"`+fkid+`","i_type":7}`, &map[string]interface{}{"$set": set}, false, false)
-		//			if id {
-		//				flag = "Y"
-		//			}
-		//}
 		redis.Put("other", "onekey_"+fkid, fkid, 10*60)
 	}
-	//}
 	m.ServeJson(map[string]interface{}{
 		"flag": flag,
 	})
@@ -812,13 +772,8 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 	if person == nil {
 		return false, nil, nil
 	}
-	log.Println(config.Sysconfig["pcSessionFlag"].(bool), flag)
-	//
 	if pcSessionFlag, ok := config.Sysconfig["pcSessionFlag"].(bool); pcSessionFlag && ok && flag {
 		userid := util.ObjToString(sessionVal["userId"])
-		// sidStr := fmt.Sprint(sess.Id())
-		// jyutil.ClearPcSession(userid, sidStr)
-		log.Println("sess:", sess.Id(), q["_id"])
 		redis.Put("other", jyutil.LoginRedisKey(userid), sess.Id(), 3600*util.IntAllDef(config.Sysconfig["pcSessionTimeout"], 168))
 	}
 	sessionVal["platform"] = typ
@@ -827,7 +782,6 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
 		"result":      "ok",
 		"s_nickname":  sessionVal["s_nickname"],
 		"s_headimage": sessionVal["s_avatar"],
-		//"encryptId":   se.EncodeString(BsonIdToSId((*person)["_id"])),
 	}
 	if openid, _ := (*person)["s_m_openid"].(string); openid != "" {
 		infoData["openid"] = se.EncodeString(openid)
@@ -867,7 +821,7 @@ func (m *Front) Sess(ostr string) error {
 						//支持多个参数%s..
 						actionurl = fmt.Sprintf(actionurl, func(tmps []string) []interface{} {
 							res := make([]interface{}, strings.Count(actionurl, "%s"))
-							for k, _ := range res {
+							for k := range res {
 								if k < len(tmps) {
 									res[k] = tmps[k]
 								} else {
@@ -920,15 +874,6 @@ func (m *Front) Sess(ostr string) error {
 	return nil
 }
 
-//修改用户推送的状态,i_ispush
-//当用户有操作的时候,认为是可以收到推送的,修改i_ispush为1
-func updateUserPushStatus(userid string) {
-	set := bson.M{"$set": bson.M{"i_ispush": 1}}
-	mongodb.UpdateById("user", userid, set)
-	mongodb.Update("follow_project", bson.M{"s_userid": userid}, set, false, true)
-	mongodb.Update("jylab_followent", bson.M{"s_userid": userid}, set, false, true)
-}
-
 //删除模板缓存
 func (d *Front) Delc(url string) {
 	defer util.Catch()
@@ -989,7 +934,6 @@ func (m *Front) GetIndexData() {
 	var one map[string]interface{}
 	if redis_obj != nil {
 		one = redis_obj.(map[string]interface{})
-		log.Println("newpage from the cache...")
 	} else {
 		rs, err := mongodb.Find("swordfish_index", nil, `{"_id":-1}`, nil, false, 0, 1)
 		if err {
@@ -1127,20 +1071,16 @@ func (f *Front) Aboutus() error {
 	if mobileReg.MatchString(f.UserAgent()) {
 		return f.Redirect("/swordfish/about" + util.If(code != "", "?code="+code, "").(string))
 	}
-	if ret := redis.Get("other", "aboutus"); ret != nil && false {
-		return f.SetBody([]byte(ret.(string)))
-	} else {
-		var shareid = f.GetString("id")
-		if len(shareid) == 0 {
-			shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jygywmy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[7:14], rand.Intn(9))
-		}
-		f.T["logid"] = config.Seoconfig["jygywmy"].(string)
-		f.T["shareid"] = se.EncodeString(shareid)
-		f.T["code"] = code
-		content, _ := f.Render4Cache("/pc/aboutus.html", &f.T)
-		redis.Put("other", "aboutus", string(content), -1)
-		return f.SetBody(content)
+	var shareid = f.GetString("id")
+	if len(shareid) == 0 {
+		shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jygywmy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[7:14], rand.Intn(9))
 	}
+	f.T["logid"] = config.Seoconfig["jygywmy"].(string)
+	f.T["shareid"] = se.EncodeString(shareid)
+	f.T["code"] = code
+	content, _ := f.Render4Cache("/pc/aboutus.html", &f.T)
+	redis.Put("other", "aboutus", string(content), -1)
+	return f.SetBody(content)
 }
 
 //商务合作
@@ -1166,7 +1106,6 @@ func (f *Front) Gethotkey() error {
 		keys = tmp.([]interface{})
 	} else {
 		if keys := public.GetHotkeys(); keys != nil && len(keys) > 0 {
-			log.Println("存储订阅词----Gethotkey")
 			redis.Put("sso", "jy_hotkeys", keys, -1)
 		}
 	}
@@ -1180,7 +1119,6 @@ func (f *Front) Rediskw() error {
 	num := f.GetString("num")
 	if skw != "" && num != "" {
 		skw = strings.Replace(strings.Replace(skw, " ", "++", -1), ";", " ", -1)
-		log.Println(skw)
 		num = se.DecodeString(num)
 		redis.Put("sso", "pc_subscribe_"+num, skw, 15*60)
 	}
@@ -1280,7 +1218,6 @@ func (f *Front) DownloadJyAppQrOther() error {
 	w.Header().Set("Expires", "0")
 	w.Header().Set("Content-Type", "image/png")
 	discored := f.GetString("discored")
-	log.Println(config.Sysconfig["webdomain"].(string) + "/X/" + discored)
 	data := config.Sysconfig["webdomain"].(string) + "/X/" + discored
 	r, _ := qr.Encode(data, qr.M)
 	pngdat := r.PNG()

+ 0 - 1
src/jfw/front/frontRouter.go

@@ -84,7 +84,6 @@ func (this *CommonRouter) PcCommonPage(folder, loginSign, htmlPage string) error
 			this.T["logid"] = config.Seoconfig["jysskzy"].(string)
 			this.T["shareid"] = se.EncodeString(shareid)
 			return this.Render("/pc/notin.html", &this.T)
-			// return this.Redirect("/notin/page")
 		}
 	}
 	if folder == "collection" {

+ 0 - 2
src/jfw/front/jyshare.go

@@ -35,8 +35,6 @@ func (m *Jyshare) Share(pid string) error {
 		tmp, err := redis.GetBytes("sso", "p_share_"+pid)
 		if err == nil {
 			pngdata = *tmp
-		} else {
-			//log.Println("get share err:", pid, err.Error())
 		}
 	}
 	w := m.ResponseWriter

+ 8 - 8
src/jfw/front/login.go

@@ -100,8 +100,8 @@ func (l *Login) Login() error {
 				datas, _ := mongodb.Find("user", map[string]interface{}{
 					"i_appid": 2,
 					"$or": []map[string]interface{}{
-						map[string]interface{}{"s_phone": phone},
-						map[string]interface{}{"s_m_phone": phone},
+						{"s_phone": phone},
+						{"s_m_phone": phone},
 					},
 				}, `{"s_phone":-1}`, `{"s_phone":1,"s_m_phone":1}`, false, 0, 1)
 				s_company := l.GetString("s_entname")
@@ -114,7 +114,7 @@ func (l *Login) Login() error {
 						"i_ts_guide":    2,
 						"s_company":     s_company,
 						"o_jy": map[string]interface{}{
-							"i_apppush":    1,
+							"i_apppush": 1,
 							// "i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
 							"i_ratemode":   2,
 							"l_modifydate": time.Now().Unix(),
@@ -184,7 +184,7 @@ func (l *Login) Register() error {
 	return l.Render("/login/register.html", &l.T)
 }
 
-//忘记密码
+// ForgetPwd 忘记密码
 func (l *Login) ForgetPwd() error {
 	defer qutil.Catch()
 	if l.Method() == "GET" {
@@ -272,8 +272,8 @@ func phoneIsExists(phone string) bool {
 	return mongodb.Count("user", map[string]interface{}{
 		"i_appid": 2,
 		"$or": []map[string]interface{}{
-			map[string]interface{}{"s_phone": phone},
-			map[string]interface{}{"s_m_phone": phone}},
+			{"s_phone": phone},
+			{"s_m_phone": phone}},
 	}) > 0
 }
 
@@ -281,8 +281,8 @@ func getPhoneUser(phone string) (bool, map[string]interface{}) {
 	datas, ok := mongodb.Find("user", map[string]interface{}{
 		"i_appid": 2,
 		"$or": []map[string]interface{}{
-			map[string]interface{}{"s_phone": phone},
-			map[string]interface{}{"s_m_phone": phone},
+			{"s_phone": phone},
+			{"s_m_phone": phone},
 		},
 	}, `{"s_phone":-1}`, `{"_id":1,"s_password":1}`, false, 0, 1)
 	if datas != nil && len(*datas) > 0 {

+ 0 - 14
src/jfw/front/pcIndex.go

@@ -7,7 +7,6 @@ import (
 	"jfw/jylabutil"
 	"jfw/public"
 	"jfw/wx"
-	"log"
 	"math/rand"
 	"qfw/util"
 	"qfw/util/bidsearch"
@@ -233,22 +232,12 @@ func GetLabUrl(typ int) interface{} {
 	return nil
 }
 
-func isin(arr []string, s string) bool {
-	for _, v := range arr {
-		if v == s {
-			return true
-		}
-	}
-	return false
-}
-
 //招标搜索数量
 func GetInfoNum() (one map[string]interface{}) {
 	defer util.Catch()
 	redis_obj := redis.Get("other", "pcsw_index")
 	if redis_obj != nil {
 		one = redis_obj.(map[string]interface{})
-		log.Println("newpage from the cache...")
 	} else {
 		rs, err := mongodb.Find("swordfish_index", nil, `{"_id":-1}`, nil, false, 0, 1)
 		if err {
@@ -398,7 +387,6 @@ func (f *PcIndex) SearchResult(at, name string) error {
 		}
 		query1 += `],"should": [],"minimum_should_match": 0}}}`
 		query := getLastNewsQuery(area, "", stype, industry, city)
-		// log.Println(query, name)
 		var datas *[]map[string]interface{}
 		if list == nil || len(list.([]interface{})) == 0 {
 			if keywords == "" {
@@ -411,8 +399,6 @@ func (f *PcIndex) SearchResult(at, name string) error {
 					startPage = 0
 				}
 				datas = elastic.GetPage(INDEX, TYPE, query, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","bidopentime","winner","buyer","bidamount","budget","s_subscopeclass","projectname"`, startPage, limitcount)
-				//log.Println("datas:", *datas)
-
 			} else {
 				//关键词
 				_, _, datas = bidsearch.GetPcBidSearchData(keywords, "", "", "", key_industry, "", "", "", "", "", "", 0, bidsearch.SearchPageSize_PC, false, nil, bidSearch_field_1, "", false)

+ 2 - 33
src/jfw/front/pchelper.go

@@ -15,7 +15,6 @@ import (
 	"strings"
 	"time"
 
-	"github.com/go-xweb/httpsession"
 	"github.com/go-xweb/xweb"
 )
 
@@ -110,8 +109,8 @@ func (l *PcHelper) Login() error {
 				datas, ok := mongodb.Find("user", map[string]interface{}{
 					"i_appid": 2,
 					"$or": []map[string]interface{}{
-						map[string]interface{}{"s_phone": phone},
-						map[string]interface{}{"s_m_phone": phone},
+						{"s_phone": phone},
+						{"s_m_phone": phone},
 					},
 				}, `{"s_phone":-1}`, `{"s_phone":1,"s_m_phone":1,"s_m_openid":1,"s_nickname":1}`, false, 0, 1)
 				if ok {
@@ -467,33 +466,3 @@ func decryptUToken(token string) (string, string) {
 	}
 	return vs[0], openid
 }
-
-//手机号登录创建session
-func PcHelperLoginInfo(phone string, Sess interface{}) {
-	if Sess == nil {
-		return
-	}
-	sess, _ := Sess.(*httpsession.Session)
-	infoData := make(map[string]interface{})
-	if phone != "" {
-		user, _ := mongodb.FindOneByField("user", `{"s_phone":"`+phone+`"}`, `{"s_nickname":1,"s_headimage":1,"s_m_openid":1,"_id":1}`)
-		if user != nil && len(*user) > 0 {
-			infoData["result"] = "ok"
-			infoData["s_nickname"] = fmt.Sprint((*user)["s_nickname"])
-			infoData["s_headimage"] = fmt.Sprint((*user)["s_headimage"])
-			infoData["encryptId"] = se.EncodeString(BsonIdToSId((*user)["_id"]))
-			infoData["shareid"] = ""
-			infoData["openid"] = se.EncodeString(phone) //add 20181116
-			(*user)["shareid"] = ""
-			nick := fmt.Sprint((*user)["s_nickname"])
-			(*user)["s_m_openid"] = phone
-			sess.Set("nickname", nick)
-			sess.Set("s_nickname", nick)
-			sess.Set("openid", phone)
-			sess.Set("s_m_openid", phone)
-			sess.Set("user", *user)
-			sess.Set("userId", BsonIdToSId((*user)["_id"]))
-			sess.Set("rpcBackUserInfo", infoData)
-		}
-	}
-}

+ 0 - 4
src/jfw/front/search.go

@@ -14,7 +14,6 @@ import (
 	"strings"
 	"time"
 
-	"github.com/go-xweb/log"
 	"github.com/go-xweb/xweb"
 )
 
@@ -67,7 +66,6 @@ func (s *Search) WxInfo() error {
 ///jylab/mainSearchStat?m=-125
 func (this *Search) MainSearchStat() error {
 	userid := util.ObjToString(this.GetSession("userId"))
-	log.Println("MainSearchStat sessionId", this.Session().Id())
 	if userid != "" { //已有session,直接跳转至结果页面
 		return this.Redirect("/jylab/mainSearch")
 	}
@@ -77,11 +75,9 @@ func (this *Search) MainSearchStat() error {
 	}
 	openid := jyutil.Getopenid(this.GetString("code")) //获取用户openid
 	if loginCreateSess(openid, this.Session()) {
-		log.Println("MainSearchStat 已关注用户", openid)
 		return this.Redirect("/jylab/mainSearch")
 	}
 	oCode := this.GetString("m")
-	log.Printf("MainSearchStat 未关注用户 %s code %s\n", openid, oCode)
 	return this.Redirect("/swordfish/about?source=open_infocontent&o=" + oCode)
 }
 

+ 1 - 1
src/jfw/front/shorturl.go

@@ -339,7 +339,7 @@ func disWordNil(disWord, userId string) string {
 	var from_userid string
 	redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
 	if redisDis != "" {
-		suffix := disWord[len(disWord)-3 : len(disWord)]
+		suffix := disWord[len(disWord)-3:]
 		//公告三级页处理
 		if suffix == suffix_msgt {
 			effectiveTimeStr := strings.Split(redisDis, "##")[3]

+ 0 - 2
src/jfw/front/supsearch.go

@@ -75,7 +75,6 @@ func PCS_list(page_type string) interface{} {
 	if page_type == "" {
 		_page_type = "page_index"
 	}
-	// log.Println(_page_type, "------", PCS_index[_page_type])
 	if PCS_index[_page_type] == nil {
 		PCS_index[_page_type] = Newbids(page_type)[0]
 	}
@@ -359,7 +358,6 @@ func (p *Pcsearch) PcSearchIndex() error {
 //
 func Newbids(p string) []interface{} {
 	pages, _ := redis.Get("other", "index_list"+p).([]interface{})
-	log.Println("----------------:", len(pages))
 	if len(pages) == 0 {
 		var list *[]map[string]interface{}
 		subtype := ""

+ 0 - 6
src/jfw/front/swordfish.go

@@ -22,7 +22,6 @@ import (
 	"regexp"
 	"strconv"
 	"strings"
-	"sync"
 	"time"
 
 	"qfw/util/jy"
@@ -39,8 +38,6 @@ const (
 	bidSearch_sort    = `{"publishtime":-1}`
 )
 
-var listlock = &sync.Mutex{}
-
 //剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
 func (m *Front) Praise() error {
 	defer util.Catch()
@@ -1353,7 +1350,6 @@ func (f *Front) Jyblog(param /*参数*/ string) error {
 	f.T["logid"] = config.Seoconfig["jybky"].(string)
 	f.DisableHttpCache()
 	shareid = se.EncodeString(shareid)
-	log.Println("====>", querymap)
 	data, pagination := SearhWebContentblog(querymap)
 	f.Render("/pc/jyblog.html", &xweb.T{"querymap": querymap, "data": data, "pagination": pagination, "shareid": shareid})
 	return nil
@@ -2002,7 +1998,6 @@ func getSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinne
 		}
 	}
 	qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","))
-	log.Println("getSearchQuery:", qstr)
 	return
 }
 
@@ -2067,7 +2062,6 @@ func wxPushViewDatas(index, itype string, keys []elastic.KeyConfig, allquery, fi
 		if start > -1 {
 			qstr = qstr[:len(qstr)-1] + `,"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(limit) + "}"
 		}
-		//log.Println("jy-ngram-find", qstr)
 		return elastic.Get(index, itype, qstr)
 	} else {
 		return nil

+ 0 - 2
src/jfw/front/uploadfile.go

@@ -39,8 +39,6 @@ func (m *Files) Upload() error {
 	res["filename"] = ""
 	if m.Method() == "POST" {
 		filetype := m.GetString("type")
-		log.Println("-", filetype)
-
 		file, FileHeader, _ := m.GetFile(filetype)
 		str := strings.Split(FileHeader.Filename, ".")
 		if str[len(str)-1:][0] == "jpg" || str[len(str)-1:][0] == "png" {

+ 0 - 2
src/jfw/front/vipsubscribe.go

@@ -7,7 +7,6 @@ import (
 	"jfw/jyutil"
 	"jfw/public"
 	"jfw/wx"
-	"log"
 	"net/url"
 	"qfw/util"
 	"qfw/util/jy"
@@ -219,7 +218,6 @@ func (s *Subscribepay) Introduce() error {
 		s.T["isLiveActive"] = true
 	}
 	obj := util.ObjToMap((*m)["o_vipjy"])
-	log.Println("disWord:", s.GetString("disWord"))
 	from := s.GetString("type") //双十一活动 接受参数renew 跳转到介绍页(续费)
 	if util.IntAll((*m)["i_vip_status"]) > 0 && from != "renew" {
 		if s.GetString("disWord") != "" {

+ 3 - 28
src/jfw/front/ws_dataExport.go

@@ -44,21 +44,13 @@ func (w *WsDataExport) WxToOrderDetail() error {
 	if openid := w.GetSession("s_m_openid"); openid != nil {
 		myOpenid = openid.(string)
 	} else {
-		checkIsSubscribeFlag := true
 		if w.GetString("state") == "wx" {
 			//微信跳回来的
 			code := w.GetString("code")
 			if code != "" {
 				openid := jyutil.Getopenid(code)
 				if openid != "" {
-					isSubscribe := true
-					if !checkIsSubscribeFlag {
-						checkIsSubscribeFlag = true
-						isSubscribe = CheckUserIsSubscribe(openid)
-					}
-					if isSubscribe {
-						FindUserAndCreateSess(openid, w.Session(), "wx", false)
-					}
+					FindUserAndCreateSess(openid, w.Session(), "wx", false)
 				}
 			}
 		} else {
@@ -205,7 +197,6 @@ func (w *WsDataExport) GetPreview() error {
 	kws := scd.Keyword
 	res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
 	if res == nil || err != nil {
-		log.Println("PreviewData查询出错")
 		return w.Render("/pc/dataExport_noDataErr.html", &w.T)
 	}
 	//格式化字段
@@ -222,7 +213,6 @@ func (w *WsDataExport) GetPreview() error {
 //预览
 func (w *WsDataExport) ToPreview(_id string) error {
 	defer util.Catch()
-	checkIsSubscribeFlag := true
 	openid, _ := w.Session().Get("s_m_openid").(string)
 	userid, _ := w.Session().Get("userId").(string)
 	if userid == "" {
@@ -232,14 +222,7 @@ func (w *WsDataExport) ToPreview(_id string) error {
 			if code != "" {
 				openid = jyutil.Getopenid(code)
 				if openid != "" {
-					isSubscribe := true
-					if !checkIsSubscribeFlag {
-						checkIsSubscribeFlag = true
-						isSubscribe = CheckUserIsSubscribe(openid)
-					}
-					if isSubscribe {
-						FindUserAndCreateSess(openid, w.Session(), "wx", false)
-					}
+					FindUserAndCreateSess(openid, w.Session(), "wx", false)
 				}
 			}
 		} else {
@@ -259,7 +242,6 @@ func (w *WsDataExport) ToPreview(_id string) error {
 //创建订单页面
 func (w *WsDataExport) SubmitOrder() error {
 	defer util.Catch()
-	checkIsSubscribeFlag := true
 	id := util.SE.Decode4Hex(w.GetString("id"))
 	openid := util.ObjToString(w.GetSession("s_m_openid"))
 	userId := util.ObjToString(w.GetSession("userId"))
@@ -270,14 +252,7 @@ func (w *WsDataExport) SubmitOrder() error {
 			if code != "" {
 				openid = jyutil.Getopenid(code)
 				if openid != "" {
-					isSubscribe := true
-					if !checkIsSubscribeFlag {
-						checkIsSubscribeFlag = true
-						isSubscribe = CheckUserIsSubscribe(openid)
-					}
-					if isSubscribe {
-						FindUserAndCreateSess(openid, w.Session(), "wx", false)
-					}
+					FindUserAndCreateSess(openid, w.Session(), "wx", false)
 				}
 			}
 		} else {

+ 3 - 13
src/jfw/front/wxMyOrder.go

@@ -7,7 +7,6 @@ import (
 	"jfw/jyutil"
 	"jfw/public"
 	"jfw/wx"
-	"log"
 	"net/url"
 	"qfw/util"
 
@@ -52,21 +51,14 @@ var (
 //
 func (w *WxMyOrder) MyMenu() error {
 	if w.Session().Get("userId") == nil {
-		checkIsSubscribeFlag := true
+
 		if w.GetString("state") == "wx" {
 			//微信跳回来的
 			code := w.GetString("code")
 			if code != "" {
 				openid := jyutil.Getopenid(code)
 				if openid != "" {
-					isSubscribe := true
-					if !checkIsSubscribeFlag {
-						checkIsSubscribeFlag = true
-						isSubscribe = CheckUserIsSubscribe(openid)
-					}
-					if isSubscribe {
-						FindUserAndCreateSess(openid, w.Session(), "wx", false)
-					}
+					FindUserAndCreateSess(openid, w.Session(), "wx", false)
 				}
 			}
 		} else {
@@ -230,7 +222,6 @@ func (w *WxMyOrder) Datas(queryM map[string]interface{}, pageNum int) (haveNextP
 
 func (t *WxMyOrder) Getpage() {
 	order_code := t.GetString("order_code")
-	log.Println("order_code", order_code)
 	c := t.GetString("c") //重开发票
 	if order_code != "" {
 		res := public.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": order_code}, "order_money,product_type,user_mail,user_phone,applybill_status", "")
@@ -248,8 +239,7 @@ func (t *WxMyOrder) Getpage() {
 
 		}
 		t.T["c"] = c
-		err := t.Render("/weixin/invoice/invoicing.html", &t.T)
-		log.Println(err)
+		_ = t.Render("/weixin/invoice/invoicing.html", &t.T)
 	}
 }
 

+ 3 - 17
src/jfw/front/wx_dataExport.go

@@ -166,11 +166,7 @@ func (w *WxDataExport) SaveData() error {
 		winnerArr = strings.Split(winner, ",")
 	}
 	if keyWord != "" {
-		err := json.Unmarshal([]byte(keyWord), &keyWordArr)
-		if err != nil {
-			log.Println("keyWord param 反序列化异常,查看前后台字段是否对应")
-		} else {
-			log.Println("keyWordArr", len(keyWordArr), keyWordArr)
+		if json.Unmarshal([]byte(keyWord), &keyWordArr) == nil {
 			for k, v := range keyWordArr {
 				if v.Appended == nil {
 					keyWordArr[k].Appended = []string{}
@@ -179,19 +175,10 @@ func (w *WxDataExport) SaveData() error {
 					keyWordArr[k].Exclude = []string{}
 				}
 			}
+		} else {
+			log.Println("keyWord param 反序列化异常,查看前后台字段是否对应")
 		}
 	}
-	//	log.Println("date", publishtime)
-	//	log.Println("area", areaArr)
-	//	log.Println("city", cityArr)
-	//	log.Println("region", regionArr)
-	//	log.Println("industry", industryArr)
-	//	log.Println("subType", subType)
-	//	log.Println("min", min)
-	//	log.Println("max", max)
-	//	log.Println("buyer", buyerArr)
-	//	log.Println("winner", winnerArr)
-	log.Println("publishtime:", publishtime)
 	saveData := map[string]interface{}{
 		"publishtime": publishtime,
 		"area":        areaArr,
@@ -217,7 +204,6 @@ func (w *WxDataExport) SaveData() error {
 		saveData["s_userid"] = w.GetSession("userId").(string)
 	}
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
-	log.Println("_id", _id)
 	w.ServeJson(bson.M{"_id": util.SE.Encode2Hex(_id)})
 	return nil
 }

+ 0 - 6
src/jfw/front/wxkeyset.go

@@ -1,4 +1,3 @@
-// wxkeyset
 package front
 
 import (
@@ -109,8 +108,6 @@ func (m *Front) WxKeysetAjaxReq() {
 		keyWords := m.GetSlice("keyWords")
 		indexs := m.GetSlice("indexs")
 		var keyMaps []map[string]interface{}
-		//给删除的关键词加上标识
-		//log.Println("keys:", a_key)
 		a_keycopy := make([]map[string]interface{}, len(a_key))
 		//复制
 		for k, v := range a_key {
@@ -156,7 +153,6 @@ func (m *Front) WxKeysetAjaxReq() {
 				}
 			}
 		}
-		//log.Println("keymaps:", keyMaps)
 		saveData["o_jy.a_key"] = keyMaps
 	} else if reqType == "saveArea" { //保存信息范围
 		index = m.GetString("index")
@@ -196,8 +192,6 @@ func (m *Front) WxKeysetAjaxReq() {
 		saveData["o_jy.i_mailpush"] = mailpush
 	} else if reqType == "delKeysWord" { //
 		index = m.GetString("index")
-		//delKeyWord := m.GetString("keyword")
-		//log.Println("index:", index, "delKeyWord:", delKeyWord)
 		var keyMaps = []map[string]interface{}{}
 		a_key, _ := m.GetSession("o_jy_a_key").([]interface{})
 		for k, v := range a_key {

+ 1 - 1
src/jfw/jylabutil/authority.go

@@ -1,4 +1,4 @@
-// authority
+// Package jylabutil authority
 package jylabutil
 
 import (

+ 1 - 1
src/jfw/jylabutil/entsearch.go

@@ -1,4 +1,4 @@
-// search
+// Package jylabutil search
 package jylabutil
 
 import (

+ 1 - 102
src/jfw/jyutil/jyutil.go

@@ -13,33 +13,18 @@ import (
 	"qfw/util/redis"
 	"regexp"
 
-	//"strconv"
-	"net/url"
 	"strings"
 	"time"
 )
 
-//计数器
-const (
-	TYPE_INVITE = iota //邀请
-	TYPE_GIVE          //赠送积分
-)
-
 var mongodb = public.MQFW
-var se *util.SimpleEncrypt = &util.SimpleEncrypt{Key: "topnet2015topnet2015"}
-var ActivityEndCode, ActivityStartCode int64
-
-var jy_activeset map[string]interface{}
+var se = &util.SimpleEncrypt{Key: "topnet2015topnet2015"}
 
 var AC = &util.AES_CBC{
 	Key: "mGlAgnIBB8bx2nch",
 	Iv:  "1389461544135476",
 }
 
-func init() {
-	jy_activeset = config.Sysconfig["jy_activeset"].(map[string]interface{})
-}
-
 //
 func FindMyShareId(activecode, openid string) string {
 	defer util.Catch()
@@ -73,75 +58,6 @@ func FindMyShareId(activecode, openid string) string {
 	return shareid
 }
 
-//基于Redis的计数器实现
-func GetShareId(businesstype int) uint32 {
-	var tmp int64
-	if businesstype == TYPE_INVITE {
-		tmp = redis.Incr("other", "invite_counter") + ActivityStartCode
-	} else if businesstype == TYPE_GIVE {
-		tmp = redis.Incr("other", "give_counter") + ActivityStartCode
-	}
-	if tmp > ActivityEndCode {
-		log.Println(ActivityEndCode, businesstype)
-		return uint32(ActivityEndCode)
-	}
-	return uint32(tmp)
-}
-
-//过滤符号
-func ReplaceSymbol(con string, rep []string) string {
-	for _, v := range rep {
-		con = strings.Replace(con, v, "", -1)
-	}
-	return con
-}
-
-//发短信,验证token
-func CheckSendMsg(token string) string {
-	if token == "" {
-		return ""
-	}
-	log.Println("短信解析前token", token)
-	key := fmt.Sprintf("smstoken_%s", token)
-	ok, e := redis.Exists("other", key)
-	if e != nil {
-		log.Println("redis中token error", e)
-		return ""
-	}
-	if ok {
-		log.Println("redis中token已存在", token)
-		return ""
-	}
-	token, e = url.QueryUnescape(token)
-	if e != nil {
-		log.Println("短信token QueryUnescape error", e)
-	}
-	v, err := AC.Decrypt(token)
-	if err != nil {
-		log.Println("短信token Decrypt error", err)
-		return ""
-	}
-	log.Println("短信解析后token", v)
-	vs := strings.Split(v, "_")
-	if len(vs) != 3 {
-		log.Println("短信token error", vs)
-		return ""
-	}
-	now := time.Now()
-	if !strings.HasPrefix(vs[1], util.FormatDate(&now, util.Date_yyyyMMdd)) {
-		log.Println("短信token date错误", vs)
-		return ""
-	}
-	if vs[2] != util.GetMd5String(fmt.Sprintf("%s&%s", vs[0], vs[1])) {
-		log.Println("短信token sing错误", vs)
-		return ""
-	}
-	if vs[0] != "" {
-		redis.Put("other", key, 1, 86400)
-	}
-	return vs[0]
-}
-
 //获取用户openid
 func Getopenid(code string) (openid string) {
 	defer util.Catch()
@@ -194,23 +110,6 @@ func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[strin
 	return person, sessionVal
 }
 
-//pc限制登陆 只允许一个账号登陆 根据lgoinrediskey判断
-//ok接口是否调用成功 isGet是否有loginRedisKey
-func ClearPcSession(userid, sessid string) (bool, bool) {
-	ok, isGet := true, true
-	//pc限制登陆
-	if sid := redis.Get("other", LoginRedisKey(userid)); sid != nil {
-		ssid, _ := sid.(string)
-		sidRds := redis.Get("session", sessid)
-		if ssid != sessid && sidRds != nil {
-			ok = redis.Del("session", ssid)
-		}
-	} else {
-		isGet = false
-	}
-	return ok, isGet
-}
-
 //value 用户sessionid
 func LoginRedisKey(userid string) string {
 	return fmt.Sprintf("login_%s", userid)

+ 0 - 11
src/jfw/jyutil/rsa_test.go

@@ -1,11 +0,0 @@
-package jyutil
-
-import (
-	"fmt"
-	"testing"
-)
-
-func Test_run(*testing.T) {
-	a := getNewRsaStruct()
-	fmt.Printf("%+v", a)
-}

+ 0 - 7
src/jfw/jyutil/sessionEncryption.go

@@ -149,13 +149,6 @@ func InitEncryptionStruct() *EncryptionStruct {
 			return &encryStruct
 		}
 	}
-	//		if isMaster {
-	//			break
-	//		} else {
-	//			log.Println("从节点获取EncryptionStruct失败,一分钟后再次尝试")
-	//			time.Sleep(time.Minute)
-	//		}
-	//	}
 
 	log.Println("主结点首次创建EncryptionStruct")
 	newRsaConf := getNewRsaConfig()

+ 5 - 7
src/jfw/jyutil/sessionkeep.go

@@ -25,7 +25,7 @@ var (
 	reg = regexp.MustCompile(`(Android|Mobile)`)
 )
 
-//session保持
+// SessionKeep session保持
 type SessionKeep struct {
 	W          http.ResponseWriter
 	R          *http.Request
@@ -131,15 +131,15 @@ func (sk *SessionKeep) cookie(userid, keyname string) *http.Cookie {
 	return cookie
 }
 
-//解密
+// DecodeString 解密
 func (sk *SessionKeep) DecodeString(encodeStr string) string {
-	byte, err := base64.StdEncoding.DecodeString(encodeStr)
+	byteArr, err := base64.StdEncoding.DecodeString(encodeStr)
 	if err != nil {
 		fmt.Println("base64解密出错", encodeStr)
 		return ""
 	}
 	//获取加密字段和加密标识
-	ctxArr := strings.Split(string(byte), "***")
+	ctxArr := strings.Split(string(byteArr), "***")
 	if len(ctxArr) != 2 {
 		return ""
 	}
@@ -152,13 +152,11 @@ func (sk *SessionKeep) DecodeString(encodeStr string) string {
 		return ""
 	}
 	str := Encryption.MapRsa[signFlsg].Decrypt(enuserid)
-	//fmt.Println(enuserid, "\n解密", signFlsg, str)
 	return str
 }
 
-//加密
+// EncodeString 加密
 func (sk *SessionKeep) EncodeString(userid string) string {
 	str := Encryption.RsaStruct_Now.Encrypt(userid) + "***" + Encryption.RsaStruct_Now.Sign
-	//fmt.Println(userid, Encryption.RsaStruct_Now.Sign, "加密", base64.StdEncoding.EncodeToString([]byte(str)))
 	return base64.StdEncoding.EncodeToString([]byte(str))
 }

+ 0 - 10
src/jfw/jyutil/sort.go

@@ -1,10 +1,6 @@
 // sort
 package jyutil
 
-import (
-	"sort"
-)
-
 type ObjectMap struct {
 	Key string `json:"key"` //
 	Num int    `json:"num"` //
@@ -29,9 +25,3 @@ func (list ObjSort) Swap(i, j int) {
 	list[i] = list[j]
 	list[j] = temp
 }
-
-func SortMap(list []*ObjectMap) []*ObjectMap {
-	pList := ObjSort(list)
-	sort.Sort(pList)
-	return pList
-}

+ 2 - 3
src/jfw/modules/app/src/app/active/active.go

@@ -12,7 +12,6 @@ import (
 
 type active struct {
 	*xweb.Action
-
 	explain xweb.Mapper `xweb:"/jyapp/free/active/explain"` //活动说明
 	info    xweb.Mapper `xweb:"/jyapp/free/active/info"`    //超级搜索页面只弹一次输入邀请码
 }
@@ -34,7 +33,7 @@ func (a *active) Info() {
 	userId, _ := a.GetSession("userId").(string)
 	now_unix := time.Now().Unix()
 	/***拉新活动 start ***/
-	pullnew := func() map[string]interface{} {
+	pullnewFuc := func() map[string]interface{} {
 		isCodeTip := false
 		isActiveTime := now_unix >= config.Active.Pullnew.StartTime && now_unix <= config.Active.Pullnew.EndTime
 		if isActiveTime && userId != "" {
@@ -64,7 +63,7 @@ func (a *active) Info() {
 	}()
 	/***拉新活动 end ***/
 	a.ServeJson(map[string]interface{}{
-		"pullnew": pullnew,
+		"pullnew": pullnewFuc,
 		"isLogin": userId != "",
 	})
 }

+ 0 - 4
src/jfw/modules/app/src/app/active/pullnew/pullnew.go

@@ -41,10 +41,6 @@ func Init() {
 	log.Println("开始加载拉新活动全部邀请码。。。")
 	sess := public.MQFW.GetMgoConn()
 	defer public.MQFW.DestoryMongoConn(sess)
-	//it := sess.DB("qfw").C(collection).Find(nil).Select(map[string]interface{}{"invitecode": 1}).Iter()
-	//for m := make(map[string]interface{}); it.Next(&m); {
-	//	hasInviteCode[util.ObjToString(m["invitecode"])] = true
-	//}
 	log.Println("拉新活动邀请码加载结束。。。", len(hasInviteCode))
 	//预先生成邀请码
 	for i := 0; i < size; i++ {

+ 0 - 12
src/jfw/modules/app/src/app/followent/followent.go

@@ -6,7 +6,6 @@ import (
 	"jfw/public"
 	. "mongodb"
 	"qfw/util"
-	"qfw/util/redis"
 	"strconv"
 	"strings"
 
@@ -15,11 +14,9 @@ import (
 )
 
 var mongodb = public.MQFW
-var se = util.SE
 
 type FollowEnt struct {
 	*xweb.Action
-
 	entList    xweb.Mapper `xweb:"/jyapp/followent/entList"`        //获取关注企业列表
 	getEntList xweb.Mapper `xweb:"/jyapp/followent/getEntList"`     //获取关注企业列表
 	addEnt     xweb.Mapper `xweb:"/jyapp/followent/addEnt"`         //添加关注企业页面
@@ -180,15 +177,6 @@ func (f *FollowEnt) QgFollow() error {
 	return nil
 }
 
-//
-func (f *FollowEnt) Followent() error {
-	//data := mongodb.FindById("user", "597ec30861fd00271cff7154", nil)
-	//data := elastic.GetPage("bidding", "bidding", "{}", `{"publishtime":-1}`, `"_id","title","publishtime","toptype","subtype","type","area","href"`, 0, 2)
-	redis.Put("sso", "followent", "9999999999999999999999", 60)
-	//log.Println("data:", redis.Get("sso", "followent"))
-	return f.Render("/followent/index.html")
-}
-
 func (f *FollowEnt) Visited() error {
 	defer util.Catch()
 	id := f.GetString("id")

+ 1 - 2
src/jfw/modules/app/src/app/front/bigMember.go

@@ -27,10 +27,9 @@ func (s *NewBigMemberAction) PowerClear() {
 	if userid == "" {
 		userid, _ = s.GetSession("userId").(string)
 	}
-	bool := jy.ClearBigVipUserPower(userid)
 	s.ServeJson(map[string]interface{}{
 		"清除大会用用户:": userid,
-		"清除结果":     bool,
+		"清除结果":     jy.ClearBigVipUserPower(userid),
 	})
 }
 

+ 13 - 13
src/jfw/modules/app/src/app/front/commonPay.go

@@ -13,17 +13,17 @@ import (
 */
 var (
 	titleMap = map[string][]string{
-		"dataexport":   []string{"数据导出"},
-		"subvip":       []string{"超级订阅试用", "超级订阅续费", "超级订阅升级", "超级订阅"},
-		"entniche":     []string{"企业商机管理"},
-		"course":       []string{"招投标课程"},
-		"datareport":   []string{"数据报告"},
-		"onlineCourse": []string{"中标必听课"},
-		"member":       []string{"大会员"},
-		"integral":     []string{"剑鱼币充值"},
-		"dataPack":     []string{"数据流量包"},
-		"areaPack":     []string{"省份订阅包"},
-		"filePack":     []string{"附件下载包"},
+		"dataexport":   {"数据导出"},
+		"subvip":       {"超级订阅试用", "超级订阅续费", "超级订阅升级", "超级订阅"},
+		"entniche":     {"企业商机管理"},
+		"course":       {"招投标课程"},
+		"datareport":   {"数据报告"},
+		"onlineCourse": {"中标必听课"},
+		"member":       {"大会员"},
+		"integral":     {"剑鱼币充值"},
+		"dataPack":     {"数据流量包"},
+		"areaPack":     {"省份订阅包"},
+		"filePack":     {"附件下载包"},
 	}
 )
 
@@ -87,14 +87,14 @@ func (w *AppPayCommon) PaySuccess(doType string) error {
 	return w.Render("/commonPay/paySuccess.html", &w.T)
 }
 
-//公对公转账页面
+// TransferAccounts 公对公转账页面
 func (this *AppPayCommon) TransferAccounts(doType string) error {
 	this.T["doType"] = doType
 	this.T["orderCode"] = this.GetString("orderCode")
 	return this.Render("/commonPay/transferAccounts.html", &this.T)
 }
 
-//对公转账提交成功页面
+// AccountsResult 对公转账提交成功页面
 func (this *AppPayCommon) AccountsResult(doType string) error {
 	this.T["doType"] = doType
 	this.T["orderCode"] = this.GetString("orderCode")

+ 10 - 19
src/jfw/modules/app/src/app/front/course.go

@@ -1,12 +1,11 @@
 package front
 
 import (
-	"qfw/util"
-
 	"github.com/go-xweb/xweb"
+	"qfw/util"
 )
 
-//课程相关接口-weixin
+// CourseInfo 课程相关接口-weixin
 type CourseInfo struct {
 	*xweb.Action
 	//页面
@@ -23,66 +22,58 @@ type CourseInfo struct {
 	orderDetail    xweb.Mapper `xweb:"/jyapp/course/orderDetail"`    //订单详情
 }
 
-func init() {
-	// 线下课程 dev3.5.2 21年2.24 下线
-	// xweb.AddAction(&CourseInfo{})
-}
-
-//
 func (c *CourseInfo) CourseDetail(id string) error {
 	defer util.Catch()
 	c.T["id"] = id
 	return c.Render("/course/course_detail.html")
 }
 
-//
 func (c *CourseInfo) CourseList() error {
 	return c.Render("/course/course_list.html")
 }
 
-//支付方式选择
 func (c *CourseInfo) OptionPay() error {
 	return c.Render("/course/optionPay.html")
 }
 
-//开发票
+// ApplyInvoice 开发票
 func (c *CourseInfo) ApplyInvoice() error {
 	return c.Render("/course/applyInvoice.html")
 }
 
-//支付成功
+// PaySuccess 支付成功
 func (c *CourseInfo) PaySuccess() error {
 	return c.Render("/course/paySuccess.html")
 }
 
-//预定课程
+// ReseverCourse 预定课程
 func (c *CourseInfo) ReseverCourse() error {
 	courseId := c.GetString("id")
 	c.T["courseId"] = courseId
 	return c.Render("/course/reseverCourse.html")
 }
 
-//退款
+// Refund 退款
 func (c *CourseInfo) Refund() error {
 	return c.Render("/course/refund.html")
 }
 
-//退款审核
+// RefundVerify 退款审核
 func (c *CourseInfo) RefundVerify() error {
 	return c.Render("/course/refundVerify.html")
 }
 
-//转账审核
+// TransferVerify 转账审核
 func (c *CourseInfo) TransferVerify() error {
 	return c.Render("/course/transferVerify.html")
 }
 
-//公对公转账
+// PublicToPublic 公对公转账
 func (c *CourseInfo) PublicToPublic() error {
 	return c.Render("/course/publicToPublic.html")
 }
 
-//订单详情
+// OrderDetail 订单详情
 func (c *CourseInfo) OrderDetail() error {
 	return c.Render("/course/orderDetail.html")
 }

+ 17 - 29
src/jfw/modules/app/src/app/front/dataExport.go

@@ -39,7 +39,7 @@ func init() {
 	xweb.AddAction(&WxDataExport{})
 }
 
-//微信数据导出
+// ToSieve 微信数据导出
 func (w *WxDataExport) ToSieve() error {
 	defer util.Catch()
 	orderCode := w.GetString("orderCode")
@@ -55,7 +55,6 @@ func (w *WxDataExport) ToSieve() error {
 		if orderCode != "" {
 			orderDetail = *public.Mysql.FindOne("dataexport_order", queryMap, "filter,pay_way,data_spec", "")
 		}
-		log.Println("-:", orderDetail)
 		if orderDetail["filter"] != nil {
 			err := json.Unmarshal([]byte(orderDetail["filter"].(string)), &filter)
 			if err == nil {
@@ -94,7 +93,7 @@ func (w *WxDataExport) ToSieve() error {
 	return nil
 }
 
-//保存筛选数据
+// SaveData 保存筛选数据
 func (w *WxDataExport) SaveData() error {
 	userId := util.ObjToString(w.GetSession("userId"))
 	if userId == "" {
@@ -185,16 +184,6 @@ func (w *WxDataExport) SaveData() error {
 			}
 		}
 	}
-	//	log.Println("date", publishtime)
-	//	log.Println("area", areaArr)
-	//	log.Println("city", cityArr)
-	//	log.Println("region", regionArr)
-	//	log.Println("industry", industryArr)
-	//	log.Println("subType", subType)
-	//	log.Println("min", min)
-	//	log.Println("max", max)
-	//	log.Println("buyer", buyerArr)
-	//	log.Println("winner", winnerArr)
 
 	saveData := map[string]interface{}{
 		"publishtime": publishtime,
@@ -221,96 +210,95 @@ func (w *WxDataExport) SaveData() error {
 		saveData["s_userid"] = w.GetSession("userId").(string)
 	}
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
-	log.Println("_id", _id)
 	w.ServeJson(bson.M{"_id": util.SE.Encode2Hex(_id)})
 	return nil
 }
 
-//区域
+// Area 区域
 func (w *WxDataExport) Area() error {
 	w.Render("/dataExport/dataExport_area.html")
 	return nil
 }
 
-//行业
+// Industry 行业
 func (w *WxDataExport) Industry() error {
 	w.Render("/dataExport/dataExport_industry.html")
 	return nil
 }
 
-//采购单位类型
+// Buyerclass 采购单位类型
 func (w *WxDataExport) Buyerclass() error {
 	w.Render("/dataExport/dataExport_setCate.html")
 	return nil
 }
 
-//关键词
+// KeyWord 关键词
 func (w *WxDataExport) KeyWord() error {
 	w.Render("/dataExport/dataExport_keyWord.html")
 	return nil
 }
 
-//关键词输入
+// KeyWordInput 关键词输入
 func (w *WxDataExport) KeyWordInput() error {
 	w.Render("/dataExport/dataExport_keyWordInput.html")
 	return nil
 }
 
-//附加词
+// Appended 附加词
 func (w *WxDataExport) Appended() error {
 	w.Render("/dataExport/dataExport_appended.html")
 	return nil
 }
 
-//附加词输入
+// AppendedInput 附加词输入
 func (w *WxDataExport) AppendedInput() error {
 	w.Render("/dataExport/dataExport_appendedInput.html")
 	return nil
 }
 
-//排除词
+// Exclude 排除词
 func (w *WxDataExport) Exclude() error {
 	w.Render("/dataExport/dataExport_exclude.html")
 	return nil
 }
 
-//排除词输入
+// ExcludeInput 排除词输入
 func (w *WxDataExport) ExcludeInput() error {
 	w.Render("/dataExport/dataExport_excludeInput.html")
 	return nil
 }
 
-//金额
+// Price 金额
 func (w *WxDataExport) Price() error {
 	w.Render("/dataExport/dataExport_price.html")
 	return nil
 }
 
-//信息类型
+// SubType 信息类型
 func (w *WxDataExport) SubType() error {
 	w.Render("/dataExport/dataExport_subType.html")
 	return nil
 }
 
-//采购单位编辑
+// BuyerEdit 采购单位编辑
 func (w *WxDataExport) BuyerEdit() error {
 	w.Render("/dataExport/dataExport_buyerEdit.html", &w.T)
 	return nil
 }
 
-//采购单位输入
+// BuyerInput 采购单位输入
 func (w *WxDataExport) BuyerInput() error {
 	w.Render("/dataExport/dataExport_buyerInput.html", &w.T)
 	return nil
 }
 
-//中标单位编辑
+// WinnerInput 中标单位编辑
 func (w *WxDataExport) WinnerInput() error {
 	w.Render("/dataExport/dataExport_winnerInput.html", &w.T)
 	return nil
 }
 
-//中标单位输入
+// WinnerEdit 中标单位输入
 func (w *WxDataExport) WinnerEdit() error {
 	w.Render("/dataExport/dataExport_winnerEdit.html", &w.T)
 	return nil

+ 0 - 1
src/jfw/modules/app/src/app/front/dataPackRouter.go

@@ -14,7 +14,6 @@ func init() {
 	xweb.AddAction(&DataPackRouter{})
 }
 
-//pc端
 func (this *DataPackRouter) PackIndex() {
 	this.Render("/dataPack/index.html")
 }

+ 2 - 4
src/jfw/modules/app/src/app/front/distrib.go

@@ -12,7 +12,7 @@ import (
 	"github.com/go-xweb/xweb"
 )
 
-//分销系统 app跳转记录日志中转
+// Distrib 分销系统 app跳转记录日志中转
 type Distrib struct {
 	*xweb.Action
 	redirectTo xweb.Mapper `xweb:"/jyapp/distrib/redirectTo"` //中转地址
@@ -23,7 +23,6 @@ func init() {
 	xweb.AddAction(&Distrib{})
 }
 
-//
 func (this *Distrib) GetERCode(disword string) error {
 	fmt.Println(disword)
 	var pngdata = []byte{}
@@ -45,7 +44,6 @@ func (this *Distrib) GetERCode(disword string) error {
 	return nil
 }
 
-
 func (this *Distrib) RedirectTo() error {
 	defer util.Catch()
 	userId, _ := this.GetSession("userId").(string)
@@ -75,7 +73,7 @@ func (this *Distrib) RedirectTo() error {
 	return this.Redirect("/jyapp/free/login?back=index&to=back&DisUrl=" + appUrl)
 }
 
-//type 1:超级订阅 2:数据导出 3:数据报告 4:中标必听课
+// ShareLogs type 1:超级订阅 2:数据导出 3:数据报告 4:中标必听课
 func (this *Distrib) ShareLogs(modular, discored, userId string) {
 	typ := 0
 	if modular == "超级订阅" {

+ 6 - 6
src/jfw/modules/app/src/app/front/entniche.go

@@ -8,14 +8,14 @@ type Entniche struct {
 	*xweb.Action
 	toSetEntPushSetPage xweb.Mapper `xweb:"/jyapp/entniche/toSetEntPushSetPage"` //订阅收费推送设置
 	pay_page            xweb.Mapper `xweb:"/entniche/payPage"`                   //支付页面
-	pay_success         xweb.Mapper `xweb:"/jypay/entniche/paySuccess"`                //支付成功
+	pay_success         xweb.Mapper `xweb:"/jypay/entniche/paySuccess"`          //支付成功
 }
 
 func init() {
 	xweb.AddAction(&Entniche{})
 }
 
-//推送设置
+// ToSetEntPushSetPage 推送设置
 func (e *Entniche) ToSetEntPushSetPage() {
 	e.Render("/entniche/entniche_seniorset.html")
 }
@@ -24,9 +24,9 @@ func (e *Entniche) Pay_page() {
 	e.Render("/entniche/entniche_gopay.html")
 }
 
-//支付成功
-func (e *Entniche)Pay_success()  {
-	order_code:=e.GetString("order_code")
+// Pay_success 支付成功
+func (e *Entniche) Pay_success() {
+	order_code := e.GetString("order_code")
 	e.T["order_code"] = order_code
-	e.Render("/entniche/pay_success.html",&e.T)
+	e.Render("/entniche/pay_success.html", &e.T)
 }

+ 1 - 2
src/jfw/modules/app/src/app/front/errLogsReceive.go

@@ -2,10 +2,9 @@ package front
 
 import (
 	"encoding/json"
+	"github.com/go-xweb/xweb"
 	"jfw/public"
 	qutil "qfw/util"
-
-	"github.com/go-xweb/xweb"
 )
 
 type ErrLogServer struct {

+ 4 - 7
src/jfw/modules/app/src/app/front/follow.go

@@ -2,13 +2,13 @@ package front
 
 import (
 	"jfw/config"
-	public "jfw/public"
+	"jfw/public"
 	"log"
 	. "mongodb"
 	"qfw/util"
 	"qfw/util/elastic"
 	"qfw/util/redis"
-	rpc "qfw/util/rpc"
+	"qfw/util/rpc"
 	"strings"
 	"time"
 
@@ -42,7 +42,6 @@ func init() {
 	followLimit = util.IntAllDef(config.Sysconfig["followProject"], 10)
 }
 
-//
 func (m *Follow) CheckFPStatus() error {
 	defer util.Catch()
 	s_id := util.DecodeArticleId2ByCheck(m.GetString("s_id"))[0]
@@ -57,7 +56,6 @@ func (m *Follow) CheckFPStatus() error {
 	return nil
 }
 
-//
 func (m *Follow) CheckCStatus() error {
 	defer util.Catch()
 	pname := m.GetString("pcname")
@@ -250,7 +248,6 @@ func (m *Follow) Photo(tp string) error {
 		id := util.DecodeArticleId2ByCheck(tpm[0])[0]
 		m.T["projectname"] = projectname
 		m.T["projectcode"] = projectcode
-		//log.Println("id:", id)
 		fields := `"_id","title","comeintime","projectcode","projectname","bidopentime","projectcode","area","toptype","subtype","type","href","publishtime","area","industry","s_subscopeclass"`
 		data := elastic.GetByIdField("bidding", "bidding", id, fields)
 		mySelf := make(bson.M)
@@ -701,7 +698,7 @@ func (m *Follow) AllNotice() error {
 		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
 			relationinfo = a_relationinfo.([]interface{})
 			//排序
-			for x, _ := range relationinfo {
+			for x := range relationinfo {
 				for y := 0; y < len(relationinfo)-x-1; y++ {
 					dt1 := util.Int64All(relationinfo[y].(map[string]interface{})["l_publishtime"])
 					dt2 := util.Int64All(relationinfo[y+1].(map[string]interface{})["l_publishtime"])
@@ -745,7 +742,7 @@ func (m *Follow) Notice(id, followId string) error {
 	if ok && data != nil && len(*data) > 0 {
 		if a_relationinfo := (*data)["a_relationinfo"]; a_relationinfo != nil {
 			relationinfo := a_relationinfo.([]interface{})
-			for x, _ := range relationinfo {
+			for x := range relationinfo {
 				s_id, _ := relationinfo[x].(map[string]interface{})["s_id"].(string)
 				relationinfo[x].(map[string]interface{})["s_id"] = util.EncodeArticleId2ByCheck(s_id)
 				for y := 0; y < len(relationinfo)-x-1; y++ {

+ 2 - 15
src/jfw/modules/app/src/app/front/front.go

@@ -10,7 +10,6 @@ import (
 	"qfw/util"
 	"qfw/util/elastic"
 	"qfw/util/jy"
-	"regexp"
 	"strings"
 	"sync"
 	"time"
@@ -95,7 +94,7 @@ func (f *Front) PushMsgCallback() {
 	f.ServeJson(map[string]interface{}{})
 }
 
-//许可协议及隐私政策
+// Policy 许可协议及隐私政策
 func (f *Front) Policy() {
 	status := 0
 	data := map[string]interface{}{}
@@ -124,8 +123,6 @@ func (f *Front) Policy() {
 func (m *Front) Receive() error {
 	defer util.Catch()
 	url_mid := m.GetString("url")
-	fmt.Println(url_mid)
-	log.Println("url_mid:", url_mid)
 	mid := ""
 	url := ""
 	if len(strings.Split(url_mid, "==")) > 1 {
@@ -144,7 +141,6 @@ func (m *Front) Receive() error {
 	defer mLock.Unlock()
 	mLock.Lock()
 	var ok = false
-	log.Println(url_mid, "---", recType, "---", userId)
 	if recType == "D" && mid != "" && len([]rune(mid)) > 12 {
 		field := "i_delivery"
 		ok = mongodb.UpdateById("message_app", mid, map[string]interface{}{"$inc": map[string]interface{}{field: 1}})
@@ -204,7 +200,6 @@ func (m *Front) Receive() error {
 //
 func mesCaLog(mid, url, userId, recType string) {
 	defer util.Catch()
-	//	log.Println(mid, "--", recType, "--", openid)
 	userData, ok1 := mongodb.FindById("user", userId, `{"s_province":1,"s_city":1,"s_nickname":1}`)
 	mesData, ok2 := mongodb.FindById("message_app", mid, `{"s_title":1,"s_subtitle":1}`)
 	if ok1 && ok2 && *mesData != nil && *userData != nil {
@@ -245,8 +240,6 @@ func isInTSguide(userid string) bool {
 		}
 	}
 	return false
-
-	return false
 }
 func (m *Front) Feedback() error {
 	defer util.Catch()
@@ -366,9 +359,6 @@ func (c *Front) Captcha() error {
 	return captcha.WriteImage(w, id, 90, 30)
 }
 
-//推送列表
-var pushGetEidReg = regexp.MustCompile("eid='(.+?)'")
-
 func (m *Front) WxpushListInfo(_id string) error {
 	defer util.Catch()
 	return m.Redirect("/jyapp/swordfish/historypush")
@@ -617,7 +607,6 @@ func (f *Front) Delc(url string) {
 	f.WriteBytes([]byte("清除路径:" + url))
 }
 
-//
 func (f *Front) IosExam() {
 	isIosExam, isIosExamPhone, isVip, isEnt := IosExamInfo(f.Action, true, true)
 	showVip, showEnt := true, true
@@ -645,7 +634,6 @@ func (f *Front) DownloadJyAppQrOther() error {
 	w.Header().Set("Expires", "0")
 	w.Header().Set("Content-Type", "image/png")
 	discored := f.GetString("discored")
-	log.Println(config.Seoconfig["jyDomain"].(string) + "/X/" + discored)
 	data := config.Seoconfig["jyDomain"].(string) + "/X/" + discored
 	r, _ := qr.Encode(data, qr.M)
 	pngdat := r.PNG()
@@ -653,9 +641,8 @@ func (f *Front) DownloadJyAppQrOther() error {
 	return err
 }
 
-//静态页面
+// QRCodePage 静态页面
 func (s *Front) QRCodePage() error {
-	fmt.Println("12312")
 	s.T["path"] = s.GetString("path")
 	return s.Render("/weixin/sharePic.html")
 }

+ 0 - 2
src/jfw/modules/app/src/app/front/laboratory.go

@@ -18,8 +18,6 @@ func init() {
 
 //剑鱼标讯实验室首页
 func (l *Lab) Index() error {
-	//return l.Render("/weixin/treasure_box.html")
-	//return l.Render("/weixin/jylab/lab-index.html")
 	return l.Redirect("/page_entniche/page/treasure_box.html")
 }
 

+ 16 - 56
src/jfw/modules/app/src/app/front/login.go

@@ -25,7 +25,7 @@ import (
 	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
-//签名
+// UserSign 签名
 type UserSign struct {
 	CreateTime int64  `json:"createtime"`
 	OpenId     string `json:"openid"`
@@ -35,7 +35,7 @@ type UserSign struct {
 	Type       int    `json:"type"`
 }
 
-////接收方式:1--app 2--邮件 3--app+邮件
+// Login 接收方式:1--app 2--邮件 3--app+邮件
 //注册登录 手机号登录 微信注册并登录 微信登录 签名登录
 //登录踢别人,自动登录检查有没有被踢出
 type Login struct {
@@ -51,7 +51,6 @@ type Login struct {
 	afterPageLoadToCheck xweb.Mapper `xweb:"/jyapp/free/afterPageLoadToCheck"` //检测
 	channelSign          xweb.Mapper `xweb:"/jyapp/free/channelSign"`          //渠道统计
 	savePushIdMsg        xweb.Mapper `xweb:"/jyapp/free/savePushIdMsg"`        //推送id记录
-	tes                  xweb.Mapper `xweb:"/jyapp/free/tes"`
 }
 
 var (
@@ -71,14 +70,7 @@ func init() {
 	}
 	go rs.GC()
 }
-func (l *Login) Tes() {
-	//uid: 5d9fe93a27573439d033b294 QQtJCABNAVEDAkFYQ1pWTVYAAgYWXUla
-	// u_secure := BsonIdToSId(person["_id"]) //Ql9FD1wRUFNQVENfEgoGRQQCUlFHCUNa
-	// simpleuid := qutil.SE.EncodeString(BsonIdToSId(person["_id"]))
-	// log.Println("uid:", u_secure, simpleuid)
-	log.Println(qutil.SE.DecodeString("Ql9FD1wRUFNQVENfEgoGRQQCUlFHCUNa"))
-	log.Println(qutil.SE.DecodeString("QQtJCABNAVEDAkFYQ1pWTVYAAgYWXUla"))
-}
+
 func (l *Login) Login() error {
 	defer qutil.Catch()
 	if l.Method() == "GET" {
@@ -89,9 +81,7 @@ func (l *Login) Login() error {
 			return l.Render("/me/login.html", &l.T)
 		} else { //带有签名的登录
 			url := l.GetString("url")
-			if url == "" {
-				log.Println("自动登录需要跳转的url为空!")
-			} else {
+			if url != "" {
 				status := 1
 				from := l.GetString("from")
 				if l.GetSession("userId") == nil || from == "restart" {
@@ -102,6 +92,8 @@ func (l *Login) Login() error {
 				} else if status == -3 {
 					return l.Redirect("/jyapp/free/login?flag=kicked&back=index")
 				}
+			} else {
+				return fmt.Errorf("自动登录需要跳转的url为空!")
 			}
 			return l.Redirect(url)
 		}
@@ -259,7 +251,7 @@ func (l *Login) Login() error {
 	return nil
 }
 
-//自动登录
+// Sess 自动登录
 func (l *Login) Sess(ostr string) error {
 	defer qutil.Catch()
 	strs := strings.Split(ostr, "__")
@@ -304,7 +296,7 @@ func (l *Login) Sess(ostr string) error {
 			if actionurl != "" {
 				if len(strs) > 1 {
 					if strings.Contains(actionurl, "followent/newInfo") {
-						actionurl = fmt.Sprintf(actionurl, (strs[1] + "___" + strs[2]))
+						actionurl = fmt.Sprintf(actionurl, strs[1]+"___"+strs[2])
 					} else {
 						//支持多个参数%s..
 						actionurl = fmt.Sprintf(actionurl, func(tmps []string) []interface{} {
@@ -362,17 +354,13 @@ func (this *RegStruct) GC() {
 var RegLock = sync.Mutex{}
 var RegMap = map[string]*RegStruct{}
 
-//app注册保存
+// Register app注册保存
 func (l *Login) Register() error {
 	defer qutil.Catch()
 	disWord := l.GetString("disWord")
 	if l.Method() == "GET" {
-		// if disWord != "" {
-		// 	l.T["disWord"] = disWord
-		// }
 		if l.GetString("step") == "2" {
 			if l.GetSession("registerStep") == "2" {
-				fmt.Println("1")
 				return l.Render("/me/setpwd.html")
 			}
 		}
@@ -515,7 +503,7 @@ func (l *Login) Register() error {
 	return nil
 }
 
-//微信注册保存并登陆
+// WxLogin 微信注册保存并登陆
 func (l *Login) WxLogin() {
 	// userid := l.GetSession("userId").(string)
 	addr := config.Sysconfig["nsq"].(string)
@@ -534,10 +522,8 @@ func (l *Login) WxLogin() {
 		}
 		var user *map[string]interface{}
 		if len(*userArr) == 1 {
-			log.Println("仅一个微信用户")
 			user = &(*userArr)[0]
 		} else if len(*userArr) > 1 {
-			log.Println("两个微信用户")
 			//处理手机号登录app,绑定已存在微信登录过app的账户,绑定后仍未之前账户
 			for _, tMap := range *userArr {
 				if tMap["s_phone"] == nil {
@@ -616,7 +602,6 @@ func (l *Login) WxLogin() {
 				returnSign = afterLogin(newUser, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
 				if disWord != "" {
 					redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
-					fmt.Println(redisDis, strings.Split(redisDis, "##")[1])
 					if redisDisArr := strings.Split(redisDis, "##"); len(redisDisArr) > 1 {
 						fromUserId := redisDisArr[1]
 						err := jy.Publish(public.Mgo_Log, addr, jy.Jywx_subscribe_invite, fromUserId, jy.Jyapp_node1)
@@ -650,7 +635,7 @@ func (l *Login) WxLogin() {
 	l.ServeJson(result)
 }
 
-//修改登录密码
+// ForgetPwd 修改登录密码
 func (l *Login) ForgetPwd() error {
 	defer qutil.Catch()
 	if l.Method() == "GET" {
@@ -676,8 +661,8 @@ func (l *Login) ForgetPwd() error {
 			if mongodb.Count("user", map[string]interface{}{
 				"i_appid": 2,
 				"$or": []map[string]interface{}{
-					map[string]interface{}{"s_phone": phone},
-					map[string]interface{}{"s_m_phone": phone}},
+					{"s_phone": phone},
+					{"s_m_phone": phone}},
 			}) == 0 {
 				return "phoneNotExists"
 			} else if jy.SendPhoneIdentCode(phone, l.Session()) {
@@ -864,8 +849,8 @@ func getPhoneUser(phone string) (bool, map[string]interface{}) {
 	users, ok := mongodb.Find("user", map[string]interface{}{
 		"i_appid": 2,
 		"$or": []map[string]interface{}{
-			map[string]interface{}{"s_phone": phone},
-			map[string]interface{}{"s_m_phone": phone}},
+			{"s_phone": phone},
+			{"s_m_phone": phone}},
 	}, `{"s_phone":-1}`, nil, false, 0, 1)
 	if users != nil && len(*users) > 0 {
 		return ok, (*users)[0]
@@ -964,7 +949,6 @@ func createSession(s *httpsession.Session, person map[string]interface{}, loginI
 	maxAge := int(time.Hour * 72 / time.Second) //3天,单位秒
 	expires := time.Now().Add(72 * time.Hour)
 	simpleuid := qutil.SE.EncodeString(BsonIdToSId(person["_id"]))
-	log.Println(simpleuid)
 	c := &http.Cookie{
 		Name:     "ud_safe",
 		Value:    simpleuid,
@@ -1118,29 +1102,6 @@ func afterLogin(user map[string]interface{}, session *httpsession.Session, rid,
 	return createSign(userid, rid, "登录后")
 }
 
-//清空这个rid
-func clearRidByRid(rid string) {
-	//用户表
-	if rid != "" {
-		mongodb.Update("user", map[string]interface{}{"s_jpushid": rid}, map[string]interface{}{
-			"$unset": map[string]interface{}{
-				"s_jpushid": "",
-				"s_opushid": "",
-			},
-		}, false, true)
-	}
-}
-
-//获取保存用户日志
-func reqPhoneInfo(req *http.Request) map[string]interface{} {
-	return map[string]interface{}{
-		"s_ip":       req.Proto,
-		"s_describe": req.Form,
-		"s_client":   req.Header.Get("user-agent"),
-		"s_method":   req.Method,
-	}
-}
-
 //解析签名
 func autoLogin(sign, from string, session *httpsession.Session, rw http.ResponseWriter) int {
 	fromIsRestart := from == "restart"
@@ -1262,7 +1223,7 @@ func (l *Login) ChannelSign() {
 	})
 }
 
-//未登录状态,打开5分钟内没有登录存储推送id
+// SavePushIdMsg 未登录状态,打开5分钟内没有登录存储推送id
 func (l *Login) SavePushIdMsg() {
 	result := false
 	deviceId := l.GetString("id")
@@ -1272,7 +1233,6 @@ func (l *Login) SavePushIdMsg() {
 	channel := l.GetString("channel")
 	if rid != "" && (deviceId != "" || phoneType == "ios") {
 		pd := &jyutil.PushDetail{Rid: rid, Oid: oid, DeviceId: deviceId, PhoneType: phoneType, Channel: channel, Createtime: time.Now().Unix()}
-		log.Printf("%+v", pd)
 		result = jyutil.UnLoginPush.SaveBuff(pd)
 	}
 	l.ServeJson(map[string]interface{}{

+ 11 - 18
src/jfw/modules/app/src/app/front/logoffuser.go

@@ -12,7 +12,7 @@ import (
 	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
-//APP用户账号注销
+// Logoffuser APP用户账号注销
 type Logoffuser struct {
 	*xweb.Action
 	outPage xweb.Mapper `xweb:"/jyapp/logoff/outpage/(.+)"` //注销相关页面
@@ -23,26 +23,23 @@ func init() {
 	xweb.AddAction(&Logoffuser{})
 }
 
-//注销页面
+// OutPage 注销页面
 func (l *Logoffuser) OutPage(pagename string) error {
 	user_id := l.GetSession("userId").(string)
 	l.T["userId"] = user_id
 	return l.Render("/me/logoff/"+pagename, &l.T)
 }
 
-//注销
+// Out 注销
 func (l *Logoffuser) Out() {
 	if !R.CheckReqParam(l.ResponseWriter, l.Request, "cause") {
 		return
 	}
-	// l.SetSession("user_id", "5e4b535c67750d392842726a")
 	user_id := l.GetSession("userId").(string)
-	log.Println(user_id)
 	status := 0
 	msg := ""
 	//获取用户注销原因
 	cause := l.GetString("cause")
-	log.Println(cause)
 	//查询是否可以注销用户
 	isOk, mess := UserIsOk(user_id)
 	if isOk == 1 {
@@ -60,7 +57,7 @@ func (l *Logoffuser) Out() {
 	return
 }
 
-//是否可以注销
+// UserIsOk 是否可以注销
 func UserIsOk(userid string) (int, string) {
 	//判断用户是否进行过用户合并
 	user, _ := mongodb.FindById("user", userid, nil)
@@ -78,7 +75,6 @@ func UserIsOk(userid string) (int, string) {
 		}
 		i_vip_status := qutil.IntAll((*user)["i_vip_status"])
 		if i_vip_status == 1 || i_vip_status == 2 || isEntnicheEnd {
-			log.Println(i_vip_status == 1, i_vip_status == 2, isEntnicheEnd)
 			return 2, "账户内有未完成的订单和服务。"
 		}
 		//修改订阅词操作
@@ -98,12 +94,9 @@ func UserIsOk(userid string) (int, string) {
 		}
 		//
 		if IsUpdateMeGtMonth(userid) || IsUpdateEntGtMonth(phone) || (isojyupdate && !isNew(qutil.Int64All((*user)["l_registedate"]), ojy_modify)) || isupdatePwd || isupdateEmail {
-			log.Println("敏感操作:", IsUpdateMeGtMonth(userid), IsUpdateEntGtMonth(phone), (isojyupdate && !isNew(qutil.Int64All((*user)["l_registedate"]), ojy_modify)), isupdatePwd, isupdateEmail)
 			return 3, "在最近一个月内,账户进行过更改密码、更改绑定信息等敏感操作。"
 		}
-		//
 		bl := (*user)["s_m_openid"] != nil && ((*user)["a_m_openid"] != nil || (*user)["s_phone"] != nil && (*user)["s_m_openid"] != (*user)["s_phone"])
-		log.Println("剑鱼标讯”公众号未取消关注:", (*user)["s_m_openid"] != nil, (*user)["a_m_openid"] != nil, (*user)["s_phone"] != nil, (*user)["s_m_openid"] != (*user)["s_phone"])
 		if bl && qutil.IntAll((*user)["i_ispush"]) != 0 {
 			return 4, "“剑鱼标讯”公众号未取消关注。"
 		}
@@ -111,7 +104,7 @@ func UserIsOk(userid string) (int, string) {
 	return 1, ""
 }
 
-//注销操作
+// LogOffAppUser 注销操作
 func LogOffAppUser(user_id, cause string) bool {
 	delete_data := map[string]interface{}{}
 	delete_data["s_cause"] = cause //注销原因
@@ -134,7 +127,7 @@ func LogOffAppUser(user_id, cause string) bool {
 	return false
 }
 
-//个人信息修改时间是否超过1个月
+// IsUpdateMeGtMonth 个人信息修改时间是否超过1个月
 func IsUpdateMeGtMonth(userId string) bool {
 	res, _ := mongodb.FindOneByField("user_auth", bson.M{"s_userid": userId}, `{"l_auditDate":1,"i_status":1}`)
 	if res != nil && len(*res) > 0 {
@@ -147,7 +140,7 @@ func IsUpdateMeGtMonth(userId string) bool {
 	return false
 }
 
-//企业修改时间及增删员工是否超过1个月
+// IsUpdateEntGtMonth 企业修改时间及增删员工是否超过1个月
 func IsUpdateEntGtMonth(phone []string) bool {
 	if len(phone) == 0 {
 		return false
@@ -193,7 +186,7 @@ func IsUpdateEntGtMonth(phone []string) bool {
 	return false
 }
 
-//是否修改过订阅设置
+// IsOjyGtMonth 是否修改过订阅设置
 func IsOjyGtMonth(ojy map[string]interface{}) (bool, int64) {
 	updatetime := qutil.Int64All(ojy["l_modifydate"])
 	now := time.Now().AddDate(0, -1, 0).Unix()
@@ -203,7 +196,7 @@ func IsOjyGtMonth(ojy map[string]interface{}) (bool, int64) {
 	return false, updatetime
 }
 
-//商机管理是否到期
+// IsEntnicheEnd 商机管理是否到期
 func IsEntnicheEnd(phone []string) bool {
 	if len(phone) == 0 {
 		return false
@@ -225,7 +218,7 @@ func IsEntnicheEnd(phone []string) bool {
 	return false
 }
 
-//是否修改过密码
+// IsUpdatePwd 是否修改过密码
 func IsUpdatePwd(updatetime int64) bool {
 	now := time.Now().AddDate(0, -1, 0).Unix()
 	if now < updatetime {
@@ -234,7 +227,7 @@ func IsUpdatePwd(updatetime int64) bool {
 	return false
 }
 
-//是否修改过邮箱 l_updatemyemail
+// IsUpdateEmail 是否修改过邮箱 l_updatemyemail
 func IsUpdateEmail(updatetime int64) bool {
 	now := time.Now().AddDate(0, -1, 0).Unix()
 	if now < updatetime {

+ 5 - 8
src/jfw/modules/app/src/app/front/me.go

@@ -5,7 +5,6 @@ import (
 	"fmt"
 	"jfw/config"
 	"jfw/public"
-	"log"
 	qutil "qfw/util"
 	"qfw/util/jy"
 	"qfw/util/redis"
@@ -50,7 +49,7 @@ func (m *Me) AppVersion() {
 	m.Render("/me/appVersion.html", &m.T)
 }
 
-//静态页面
+// StaticPage 静态页面
 func (m *Me) StaticPage(pagename string) error {
 	return m.Render("/staticpage/" + pagename)
 }
@@ -69,7 +68,7 @@ func (m *Me) MeIndex() error {
 			m.T["member_status"] = qutil.If((*res)["i_member_status"] != nil, qutil.Int64All((*res)["i_member_status"]), 0)
 			power := []int{} //GetNewPower(userid)
 			powerMap := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW).PowerMap
-			for k, _ := range powerMap {
+			for k := range powerMap {
 				power = append(power, k)
 			}
 			m.T["power"] = power
@@ -128,7 +127,7 @@ func (m *Me) Notice() error {
 		mongodb.Update("jyapp_notice", map[string]interface{}{
 			"s_userid": userId,
 			"i_unread": 1,
-			"$and":     []bson.M{bson.M{"s_type": bson.M{"$ne": "message"}}, bson.M{"s_type": bson.M{"$ne": "titleMessage"}}},
+			"$and":     []bson.M{{"s_type": bson.M{"$ne": "message"}}, {"s_type": bson.M{"$ne": "titleMessage"}}},
 		}, map[string]interface{}{
 			"$set": map[string]interface{}{
 				"i_unread":    0,
@@ -148,11 +147,11 @@ func (m *Me) NoticeList() {
 		}, `{"l_comeintime":-1}`, nil, false, pageNum*100, 100)
 	}
 	if public.Mysql.CountBySql("select count(*) from dis_partner where uid=? and type!=3 ", userId) > 0 {
-		for key, _ := range *list {
+		for key := range *list {
 			(*list)[key]["isExhibition"] = false
 		}
 	} else {
-		for key, _ := range *list {
+		for key := range *list {
 			(*list)[key]["isExhibition"] = true
 		}
 	}
@@ -269,7 +268,6 @@ func (l *Me) CheckUpdate() error {
 	if userId != "" && (l.GetString("from") == "server-appVersion-2" || l.GetString("from") == "server-mainSearch") {
 		redis.Put(ClientUpdate.RedisCode, "app_clientupdate_"+userId, 1, 5)
 	}
-	log.Println("检查是否更新", "from", l.GetString("from"), "userId", userId, "version", version, "channel", channel, "phonetype", l.GetString("phonetype"), "system", l.GetString("system"), "User-Agent", l.Header("User-Agent"), "result", result)
 	l.ServeJson(result)
 	return nil
 }
@@ -376,7 +374,6 @@ func (l *Me) AccountSafe() error {
 
 func (l *Me) GetAccountInfo() {
 	userid := l.GetSession("userId").(string)
-	log.Println(userid)
 	info := map[string]interface{}{}
 
 	res, _ := public.MQFW.FindById("user", userid, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)

+ 2 - 11
src/jfw/modules/app/src/app/front/myorder.go

@@ -2,7 +2,6 @@ package front
 
 import (
 	"jfw/public"
-	"log"
 	"qfw/util"
 	"strconv"
 	"strings"
@@ -44,18 +43,15 @@ var (
 	orderStatus_deleted     = "-1"               //订单状态-已删除
 	orderStatus_cancel      = "-2"               //order_status  : 0:待支付; 1:已完成;  -1:已删除; -2:已取消
 	tableName_order         = "dataexport_order" //订单表
-	order_pageSize          = 10
 )
 
 func (m *MyOrder) GetOneMore() error {
 	defer util.Catch()
 	pageNum, _ := m.GetInteger("pageNum")
-	log.Println("pageNum:", pageNum)
 	tabType := m.GetString("tabType")
 	userId := m.Session().Get("userId")
 	queryM := map[string]interface{}{}
 	nextPage := false
-	log.Println("user:", userId)
 	queryM["user_id"] = userId
 	var status string
 	if tabType == "1" {
@@ -68,11 +64,10 @@ func (m *MyOrder) GetOneMore() error {
 	_, resData, _ := m.Datas(queryM, (pageNum - 1))
 	//和取消支付不同  支付完成 获取最后一条订单 获取的是当前页面的最后一条 (不是下一页第一条
 	if len(resData) > 0 {
-		resData = resData[(len(resData) - 1):len(resData)]
+		resData = resData[(len(resData) - 1):]
 		//用于删除订单后 判断新增的订单之后 是否有下一页
 		nextPage = true
 	}
-	log.Println("res:", resData)
 
 	//start := (pageNum - 1) * pagesize_max
 	//resData := *public.Mysql.Find(tableName_order, queryM, "id,order_code,filter_publishtime,create_time,data_spec,filter_id,filter_keys,order_money,data_count,order_status", "create_time desc", start, 1)
@@ -267,7 +262,6 @@ func (m *MyOrder) Datas(queryM map[string]interface{}, pageNum int) (haveNextPag
 
 func (m *MyOrder) ToEntnicheDetail() {
 	m.T["order_code"] = m.GetString("order_code")
-	log.Println(m.T["order_code"])
 	m.Render("/entniche/entniche_order_detail.html", &m.T)
 }
 
@@ -283,7 +277,6 @@ func (m *MyOrder) TointegralDetail() {
 
 func (t *MyOrder) Getpage() {
 	order_code := t.GetString("order_code")
-	log.Println("order_code", order_code)
 	c := t.GetString("c") //重开发票
 	sys_error := t.GetString("isSys")
 	if order_code != "" {
@@ -303,10 +296,8 @@ func (t *MyOrder) Getpage() {
 		}
 		t.T["c"] = c
 		t.T["sys_err"] = sys_error
-		err := t.Render("/invoice/invoicing.html", &t.T)
-		log.Println(err)
+		_ = t.Render("/invoice/invoicing.html", &t.T)
 	}
-
 }
 
 func (t *MyOrder) Check_invoice() {

+ 2 - 9
src/jfw/modules/app/src/app/front/shorturl.go

@@ -11,14 +11,12 @@ import (
 
 	//"math/rand"
 	. "app/jyutil"
+	"github.com/go-xweb/xweb"
 	"jfw/public"
 	"log"
 	"qfw/util"
 	"qfw/util/jy"
 	"qfw/util/redis"
-	"regexp"
-
-	"github.com/go-xweb/xweb"
 )
 
 type Short struct {
@@ -32,13 +30,8 @@ func init() {
 	xweb.AddAction(&Short{})
 }
 
-var regex = regexp.MustCompile("(Android|Mobile)")
 var DateFullLayout = "2006-01-02 15:04:05"
 var suffix_msgt = "_SX"
-var Map_stype = map[string]bool{
-	"content":   true,
-	"bdprivate": true,
-}
 
 func (s *Short) Article(stype, id string) error {
 	//先判断是否有session
@@ -52,7 +45,7 @@ func (s *Short) Article(stype, id string) error {
 	if disWord != "" {
 		redisDis := redis.GetStr("other", "DIS_"+disWord[1:])
 		if redisDis != "" {
-			suffix := disWord[len(disWord)-3 : len(disWord)]
+			suffix := disWord[len(disWord)-3:]
 			//公告三级页处理
 			if suffix == suffix_msgt {
 				effectiveTimeStr := strings.Split(redisDis, "##")[3]

+ 6 - 6
src/jfw/modules/app/src/app/front/structedData.go

@@ -32,7 +32,7 @@ func init() {
 	xweb.AddAction(&StructedData{})
 }
 
-//验证邮箱的正确性
+// VerifyEmail 验证邮箱的正确性
 func (t *StructedData) VerifyEmail() {
 	defer util.Catch()
 	msg := "请求方式有误"
@@ -67,7 +67,7 @@ func (t *StructedData) VerifyEmail() {
 	})
 }
 
-//验证 验证码的正确性
+// VerifyCode 验证 验证码的正确性
 func (t *StructedData) VerifyCode() {
 	defer util.Catch()
 	msg := "请求方式有误"
@@ -114,7 +114,7 @@ func (t *StructedData) VerifyCode() {
 	})
 }
 
-//保存免费样例数据
+// FreeSamples 保存免费样例数据
 func (t *StructedData) FreeSamples() error {
 	defer util.Catch()
 	msg := "请求方式有误"
@@ -171,7 +171,7 @@ func (t *StructedData) FreeSamples() error {
 	return nil
 }
 
-//发送邮件
+// SendMailVerify 发送邮件
 func (t *StructedData) SendMailVerify() {
 	defer util.Catch()
 	if t.Method() == "POST" {
@@ -239,7 +239,7 @@ func (t *StructedData) Index() error {
 	return t.Render("/structeddata/marketing.html", &t.T)
 }
 
-//信息填写
+// WriteInfo 信息填写
 func (t *StructedData) WriteInfo() error {
 	userId := util.ObjToString(t.GetSession("userId"))
 	if userId != "" {
@@ -274,7 +274,7 @@ func (t *StructedData) Success() error {
 	return t.Render("/structeddata/write_result.html")
 }
 
-//结构化数据预览
+// GetPreview 结构化数据预览
 func (t *StructedData) GetPreview() error {
 	return t.Render("/structeddata/preview.html")
 }

+ 0 - 41
src/jfw/modules/app/src/app/front/swordfish.go

@@ -13,7 +13,6 @@ import (
 	"qfw/util/jy"
 	"qfw/util/redis"
 	"strings"
-	"sync"
 	"time"
 
 	"github.com/go-xweb/httpsession"
@@ -27,11 +26,8 @@ const (
 	FINDF             = `"title"`
 	bidSearch_field_1 = `"_id","title","publishtime","toptype","subtype","type","area","s_subscopeclass","buyerclass","bidamount","budget"`
 	bidSearch_field   = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
-	bidSearch_sort    = `{"publishtime":-1}`
 )
 
-var listlock = &sync.Mutex{}
-
 //剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
 func (m *Front) Praise() error {
 	defer util.Catch()
@@ -454,39 +450,6 @@ func (f *Front) Historypush() error {
 	return f.Render("/weixin/historypush.html", &f.T)
 }
 
-/*
-func (f *Front) HistorypushPaging() error {
-	userId, _ := f.GetSession("userId").(string)
-	if userId == "" {
-		return nil
-	}
-	pageNum, _ := f.GetInteger("pageNum")
-	if pageNum == 1 {
-		go updateUserApppushunread(userId)
-	}
-	hasNextPage, list := jy.SubscribePush.Datas(&jy.SubPushQueryParam{
-		Mgo_bidding:   public.Mgo_Bidding,
-		Bidding:       public.DbConf.Mongodb.Bidding.Collection,
-		Bidding_back:  public.DbConf.Mongodb.Bidding.Collection_back,
-		PushMysql:     public.PushMysql,
-		UserId:        userId,
-		PageNum:       pageNum,
-		SelectTime:    f.GetString("selectTime"),
-		Area:          f.GetString("area"),
-		City:          f.GetString("city"),
-		Buyerclass:    f.GetString("buyerclass"),
-		Subtype:       f.GetString("subtype"),
-		Subscopeclass: f.GetString("subscopeclass"),
-		Key:           f.GetString("key"),
-	})
-	jy.SubscribePush.MakeCollection(userId, public.Mysql, list)
-	f.ServeJson(map[string]interface{}{
-		"hasNextPage": hasNextPage,
-		"data":        list,
-	})
-	return nil
-}*/
-
 func MFollow(userId, pname, pcode, title string) (bool, string) {
 	defer util.Catch()
 	var followId string
@@ -672,7 +635,3 @@ func (m *Front) DelOL() error {
 	})
 	return nil
 }
-
-func updateUserApppushunread(userid string) {
-	mongodb.UpdateById("user", userid, map[string]interface{}{"$set": map[string]interface{}{"i_apppushunread": 0}})
-}

+ 3 - 5
src/jfw/modules/app/src/app/front/tencentcloud.go

@@ -27,7 +27,7 @@ import (
 	"github.com/go-xweb/xweb"
 )
 
-//腾讯人脸认证订单号:分销ORC识别订单号:A***  人脸识别订单号:B****
+// Tencentcloud 腾讯人脸认证订单号:分销ORC识别订单号:A***  人脸识别订单号:B****
 type Tencentcloud struct {
 	*xweb.Action
 	ocr        xweb.Mapper `xweb:"/jyapp/tencentcloud/ocr"`
@@ -373,11 +373,11 @@ func GetAccessToken() {
 //随机数
 func GetRandomString(l int) string {
 	str := "0123456789abcdefghijklmnopqrstuvwxyz"
-	bytes := []byte(str)
+	bytesArr := []byte(str)
 	result := []byte{}
 	r := rand.New(rand.NewSource(time.Now().UnixNano()))
 	for i := 0; i < l; i++ {
-		result = append(result, bytes[r.Intn(len(bytes))])
+		result = append(result, bytesArr[r.Intn(len(bytesArr))])
 	}
 	return string(result)
 }
@@ -394,7 +394,6 @@ func HttpPost(href, contentType, param string, timeout int) (int, int64, map[str
 	}
 	defer resp.Body.Close()
 	body, _ := ioutil.ReadAll(resp.Body)
-	log.Println(string(body))
 	var data map[string]interface{}
 	if err := json.Unmarshal(body, &data); err != nil {
 		log.Println("HttpGet Unmarshal err:", err)
@@ -436,7 +435,6 @@ func Sign(param ...string) string {
 
 //获取用户伙伴id  -1:未找到
 func getPartnerId(userid string) int {
-	log.Println(userid)
 	partner := public.Mysql.FindOne("dis_partner", map[string]interface{}{"uid": userid}, "id", "")
 	if partner == nil {
 		return -1

+ 2 - 3
src/jfw/modules/app/src/app/front/uploadfile.go

@@ -29,7 +29,7 @@ func init() {
 	xweb.AddAction(&Files{})
 }
 
-//对上传文件的处理,如果存在resize参数,刚剪裁图片
+// Upload 对上传文件的处理,如果存在resize参数,刚剪裁图片
 func (m *Files) Upload() error {
 	fileTypeArray := FileType
 	res := map[string]interface{}{}
@@ -39,7 +39,6 @@ func (m *Files) Upload() error {
 	res["filename"] = ""
 	if m.Method() == "POST" {
 		filetype := m.GetString("type")
-		log.Println("-", filetype)
 
 		file, FileHeader, _ := m.GetFile(filetype)
 		str := strings.Split(FileHeader.Filename, ".")
@@ -126,7 +125,7 @@ type Stat interface {
 	Stat() (os.FileInfo, error)
 }
 
-//获取文件路径、名称
+// Getfilepath 获取文件路径、名称
 func Getfilepath(str, filetype string) (s string) {
 	var strs = time.Now().Format("20060102150405001")
 	var name = strs + util.GetComplexRandom(8, 0, 0) + "." + str

+ 5 - 15
src/jfw/modules/app/src/app/front/ws_dataExport.go

@@ -22,8 +22,7 @@ import (
 
 type WsDataExport struct {
 	*xweb.Action
-	searchExport xweb.Mapper `xweb:"/jyapp/front/dataExport/searchExport"` //app数据导出
-	//paySuccessPage    xweb.Mapper `xweb:"/jyapp/front/dataExport/paySuccessPage"`    //app数据导出-支付成功页面
+	searchExport      xweb.Mapper `xweb:"/jyapp/front/dataExport/searchExport"`      //app数据导出
 	toCreateOrderPage xweb.Mapper `xweb:"/jyapp/front/dataExport/toCreateOrderPage"` //app数据导出-订单支付
 	sendMailVerify    xweb.Mapper `xweb:"/jyapp/front/dataExport/sendMailVerify"`    //发送邮箱验证码
 	checkMailVerify   xweb.Mapper `xweb:"/jyapp/front/dataExport/checkMailVerify"`   //验证邮箱验证码
@@ -48,7 +47,6 @@ func (w *WsDataExport) GetPreview() error {
 	//数据预览每天限制50次
 	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day())
 	times := util.IntAll(redis.Get("other", incurKey))
-	log.Println("times:", times)
 	if times >= 50 {
 		_res["msg"] = "超出预览次数"
 		w.ServeJson(map[string]interface{}{
@@ -68,7 +66,6 @@ func (w *WsDataExport) GetPreview() error {
 	kws := scd.Keyword
 	res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
 	if res == nil || err != nil {
-		log.Println("PreviewData查询出错")
 		return w.Render("/pc/dataExport_noDataErr.html", &w.T)
 	}
 	//格式化字段
@@ -117,7 +114,6 @@ func (w *WsDataExport) SendMailVerify() {
 			lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
 			timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
 			incurKey := fmt.Sprintf("SendEmail_%s_%d", w.GetSession("userId"), time.Now().Day())
-			//log.Println(incurKey)
 			if lastSendDEVerify == 0 || timeSpaceing < 0 {
 				//每日限制10次
 				times := util.IntAll(redis.Get("other", incurKey))
@@ -171,7 +167,7 @@ func (w *WsDataExport) CheckPhoneVerify() {
 	w.ServeJson(&w.T)
 }
 
-//验证邮箱
+// CheckMailVerify 验证邮箱
 func (w *WsDataExport) CheckMailVerify() {
 	email := w.GetString("email")
 	emailVerity := w.GetString("emailVerity")
@@ -199,8 +195,7 @@ func (w *WsDataExport) PreviewData(_id string) error {
 	w.T["id"] = _id
 	w.T["dataType"] = w.GetString("dataType")
 	w.T["ttf"] = public.GetFontVersion() + "_" + public.PC
-	w.Render("/dataExport/dataExport_previewData.html", &w.T)
-	return nil
+	return w.Render("/dataExport/dataExport_previewData.html", &w.T)
 }
 
 func subUrl(list *[]map[string]interface{}, dataType string) *[]map[string]interface{} {
@@ -257,14 +252,12 @@ func (w *WsDataExport) ToCreateOrderPage() error {
 	if userId == "" {
 		return errors.New("未登录")
 	}
-	log.Println(id)
 	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, id)
 	if msgCount > public.ExConf.MsgMaxCount || msgCount == -1 {
 		msgCount = public.ExConf.MsgMaxCount
 	}
 	if msgCount < 1 {
-		w.Render("/dataExport/404.html", &w.T)
-		return nil
+		return w.Render("/dataExport/404.html", &w.T)
 	}
 
 	resEmail, _ := w.GetSession("DataExportVerifyEmail_val").(string)
@@ -469,8 +462,5 @@ func (m *WsDataExport) ToOrderDetail() error {
 		}()
 	}
 	m.T["o"] = orderDetail
-	log.Println(orderDetail)
-	error := m.Render("/dataExport/dataExport_toOrderDetail.html", &m.T)
-	log.Println(error)
-	return nil
+	return m.Render("/dataExport/dataExport_toOrderDetail.html", &m.T)
 }

+ 2 - 6
src/jfw/modules/app/src/app/front/wxkeyset.go

@@ -1,4 +1,4 @@
-// wxkeyset
+// Package front wxkeyset
 package front
 
 import (
@@ -16,7 +16,7 @@ import (
 	"time"
 )
 
-//进入订阅词设置
+// WxKeyset 进入订阅词设置
 func (m *Front) WxKeyset(tpl string) error {
 	defer util.Catch()
 	userid := util.ObjToString(m.GetSession("userId"))
@@ -93,7 +93,6 @@ func (m *Front) WxKeysetAjaxReq() {
 		indexs := m.GetSlice("indexs")
 		var keyMaps []map[string]interface{}
 		//给删除的关键词加上标识
-		//log.Println("keys:", a_key)
 		a_keycopy := make([]map[string]interface{}, len(a_key))
 		//复制
 		for k, v := range a_key {
@@ -139,7 +138,6 @@ func (m *Front) WxKeysetAjaxReq() {
 				}
 			}
 		}
-		//log.Println("keymaps:", keyMaps)
 		saveData["o_jy.a_key"] = keyMaps
 	} else if reqType == "saveArea" { //保存信息范围
 		index = m.GetString("index")
@@ -178,8 +176,6 @@ func (m *Front) WxKeysetAjaxReq() {
 		saveData["o_jy.i_mailpush"] = mailpush
 	} else if reqType == "delKeysWord" { //
 		index = m.GetString("index")
-		//delKeyWord := m.GetString("keyword")
-		//log.Println("index:", index, "delKeyWord:", delKeyWord)
 		var keyMaps = []map[string]interface{}{}
 		a_key, _ := m.GetSession("o_jy_a_key").([]interface{})
 		for k, v := range a_key {

+ 8 - 23
src/jfw/modules/app/src/app/jylabutil/authority.go

@@ -1,4 +1,4 @@
-// authority
+// Package jylabutil authority
 package jylabutil
 
 import (
@@ -6,11 +6,10 @@ import (
 	qu "qfw/util"
 )
 
-/**设置用户权限
-userid 用户_id
-field  用户权限属性字段
-value  用户权限值
-*/
+//UpdateAuthory 设置用户权限
+//userid 用户_id
+//field  用户权限属性字段
+//value  用户权限值
 func UpdateAuthory(userid, field string, value int) bool {
 	b := public.MQFW.UpdateById("user", userid,
 		map[string]interface{}{
@@ -21,23 +20,9 @@ func UpdateAuthory(userid, field string, value int) bool {
 	return b
 }
 
-/**设置用户权限
-userid 用户_id
-field  用户权限属性字段
-kv     更改多个权限值
-*/
-func UpdateAuthorys(userid string, kv map[string]int) bool {
-	b := public.MQFW.UpdateById("user", userid,
-		map[string]interface{}{
-			"$set": kv,
-		})
-	return b
-}
-
-/**获取当前模块是否有权限
-userid 用户_id
-field  用户权限属性字段
-*/
+//IsAuthorized 获取当前模块是否有权限
+//userid 用户_id
+//field  用户权限属性字段
 func IsAuthorized(userid, field string) bool {
 	user, b := public.MQFW.FindById("user", userid, nil)
 	if len(*user) > 0 && b {

+ 4 - 73
src/jfw/modules/app/src/app/jylabutil/entsearch.go

@@ -1,16 +1,14 @@
-// search
+// Package jylabutil search
 package jylabutil
 
 import (
 	"fmt"
 	"qfw/util/elastic"
-	"strings"
 )
 
-/**即时获取企业名称列表
-name  名称
-limit 取几条
-*/
+//GetEenNameImmediate 即时获取企业名称列表
+//name  名称
+//limit 取几条
 func GetEenNameImmediate(name string, limit int) []map[string]interface{} {
 	query := `{"query": {
 			    "bool": {
@@ -27,70 +25,3 @@ func GetEenNameImmediate(name string, limit int) []map[string]interface{} {
 	list := *elastic.Get("winner", "winner", query)
 	return list
 }
-
-/*根据企业名称、地区、中标价获取项目列表
-entname 企业名称
-area	区域多值","号隔开
-lower	下限单位万
-upper	上限单位万
-pagenum	页码
-pagesize每页数量
-*/
-func GetProjectByEntName(entname string, area string, lower, upper float64, fields string, pagenum, pagesize int, getCount bool) (int, []map[string]interface{}) {
-	if pagenum < 1 {
-		pagenum = 1
-	}
-	mastquery := getSearchQuery(entname, area, lower, upper)
-	var count int
-	if getCount && pagenum == 1 {
-		countQuery := `{"query":{"bool":{"must":[` + mastquery + `]}}}`
-		count = int(elastic.Count("projectset", "projectset", countQuery))
-	}
-	list := *elastic.GetByNgram(
-		"projectset", "projectset",
-		``, mastquery,
-		"",
-		`{"jgtime":-1,"createtime":-1}`, fields, (pagenum-1)*pagesize, pagesize,
-	)
-	return count, list
-}
-
-func getSearchQuery(entname, area string, lower, upper float64) string {
-	query := ``
-	if entname != "" {
-		query = `{"term":{"s_winner":"` + entname + `"}}`
-	}
-	if area != "" {
-		if len(query) > 0 {
-			query += ","
-		}
-		query += `{"terms":{"area":[`
-		for k, v := range strings.Split(area, ",") {
-			if k > 0 {
-				query += `,`
-			}
-			query += `"` + v + `"`
-		}
-		query += `]}}`
-	}
-	if lower > 0 && upper > 0 {
-		if len(query) > 0 {
-			query += ","
-		}
-		query += `{"range":{"bidamount":{"gte":` + fmt.Sprint(lower*10000) + `,"lte":` + fmt.Sprint(upper*10000) + `}}}`
-	} else {
-		if lower > 0 {
-			if len(query) > 0 {
-				query += ","
-			}
-			query += `{"range":{"bidamount":{"gte":` + fmt.Sprint(lower*10000) + `}}}`
-		}
-		if upper > 0 {
-			if len(query) > 0 {
-				query += ","
-			}
-			query += `{"range":{"bidamount":{"lte":` + fmt.Sprint(upper*10000) + `}}}`
-		}
-	}
-	return query
-}

+ 0 - 1
src/jfw/modules/app/src/app/jyutil/clientupdate.go

@@ -17,7 +17,6 @@ type clientUpdate struct {
 	RedisCode string
 }
 
-//
 func (c *clientUpdate) IsNeedUpdate(userId, version, channel string, androidVersion int, grayUpdate bool) bool {
 	update, _ := Sysconfig["update"].(map[string]interface{})
 	updateFlag := true

+ 1 - 1
src/jfw/modules/app/src/app/jyutil/rpccall.go

@@ -13,7 +13,7 @@ func init() {
 	rpcserver = config.Sysconfig["weixinrpc"].(string)
 }
 
-//分享二维码图片
+// GetQrCodeFromWx 分享二维码图片
 func GetQrCodeFromWx(id string) string {
 	var ret string
 	util.Try(func() {

+ 0 - 24
src/jfw/modules/app/src/app/pay/wxpay.go

@@ -1,24 +0,0 @@
-package pay
-
-import (
-	"jfw/config"
-	"jfw/public"
-	"qfw/util"
-)
-
-func init() {
-	payConfig := config.WeixinConfig["pay"].(map[string]interface{})
-	public.WxStruct = &public.WeixinStruct{
-		Appid:             util.ObjToString(config.WeixinConfig["appid"]),
-		Mchid:             util.ObjToString(payConfig["mchid"]),
-		Key:               util.ObjToString(payConfig["key"]),
-		Dashang_attachmsg: util.ObjToString(payConfig["attachmsg"]),
-		Dashang_bodymsg:   util.ObjToString(payConfig["bodymsg"]),
-		Dashang_detailmsg: util.ObjToString(payConfig["detailmsg"]),
-		Sjdc_attachmsg:    util.ObjToString(payConfig["sjdc_attachmsg"]),
-		Sjdc_bodymsg:      util.ObjToString(payConfig["sjdc_bodymsg"]),
-		Sjdc_detailmsg:    util.ObjToString(payConfig["sjdc_detailmsg"]),
-		Sjbg_msg:          util.ObjToString(payConfig["sjbd_msg"]),
-		//Subvip_msg:        util.ObjToString(payConfig["subvip_msg"]),
-	}
-}

+ 1 - 37
src/jfw/modules/app/src/app/tag/msg.go

@@ -9,7 +9,7 @@ import (
 	"time"
 )
 
-//从json配置文件中读取值
+// Msg 从json配置文件中读取值
 func Msg(mtype, key string) string {
 	return readproperty(mtype, key)
 }
@@ -25,42 +25,6 @@ func SafeUrl(s string) template.URL {
 	return template.URL(s)
 }
 
-//
-func DateTip(date2 int64) (timedate string) {
-	timedate = "30秒前"
-	date1 := time.Now().Unix()
-	td := date1 - date2
-	//天数
-	var days = td / (24 * 3600)
-	//小时
-	var leave1 = td % (24 * 3600)
-	var hours = leave1 / 3600
-	//分钟
-	var leave2 = leave1 % 3600
-	var minutes = leave2 / 60
-	if days > 0 {
-		if days > 10 {
-			var date1fm = time.Unix(date1, 0).Format("2006-01-02")
-			var date2fm = time.Unix(date2, 0).Format("2006-01-02")
-			date1fmyear := strings.Split(date1fm, "-")[0]
-			date2fmyear := strings.Split(date2fm, "-")[0]
-			if date1fmyear > date2fmyear {
-				timedate = date2fm
-			} else {
-				timedate = time.Unix(date2, 0).Format("01-02")
-			}
-		} else {
-			timedate = strconv.FormatInt(days, 10) + "天"
-		}
-	} else if hours > 0 {
-		timedate = strconv.FormatInt(hours, 10) + "小时"
-	} else if minutes > 0 {
-		timedate = strconv.FormatInt(minutes, 10) + "分钟"
-	}
-	return
-}
-
-//
 func readproperty(mtype, key string) string {
 	switch mtype {
 	case "seo":

BIN
src/jfw/modules/app/src/appsrc


+ 4 - 21
src/jfw/modules/app/src/jfw/config/config.go

@@ -5,42 +5,25 @@ import (
 	"qfw/util/mail"
 )
 
-//seo.josn 配置文件中的版本号,可以动态更新
+// Seoconfig_Version seo.josn 配置文件中的版本号,可以动态更新
 var Seoconfig_Version string
 
-//Seoconfig_Version 作为固定版本号 除非大版本更新需要改动,其他都更改Seoconfig_Mod_Version  王山  2020/06/11
+// Seoconfig_Mod_Version Seoconfig_Version 作为固定版本号 除非大版本更新需要改动,其他都更改Seoconfig_Mod_Version  王山  2020/06/11
 var Seoconfig_Mod_Version string
 
 var Seoconfig_Cdns map[string]interface{}
 var Sysconfig map[string]interface{}
 var PhoneFilterConfig map[string]interface{}
 var Seoconfig map[string]interface{}
-var WeixinConfig map[string]interface{}
 
 var GmailAuth []*mail.GmailAuth
 
-type mgoConf struct {
-	Main *mgo
-	Log  *mgo
-	Ent  *mgo
-}
-type mgo struct {
-	Address  string
-	Size     int
-	DbName   string
-	UserName string
-	Password string
-}
-
-var MgoConf *mgoConf
-
 func init() {
 	util.ReadConfig(&Sysconfig)
-	WeixinConfig, _ = Sysconfig["wxJianyu"].(map[string]interface{})
 	mails, _ := Sysconfig["mail"].([]interface{})
 	mailConfigArrMap := util.ObjArrToMapArr(mails)
 	for _, v := range mailConfigArrMap {
-		mail := &mail.GmailAuth{
+		mailConf := &mail.GmailAuth{
 			SmtpHost: v["addr"].(string),
 			SmtpPort: util.IntAll(v["port"]),
 			User:     v["user"].(string),
@@ -48,6 +31,6 @@ func init() {
 			//			PoolChan: nil,
 			//			PoolSize: 0,
 		}
-		GmailAuth = append(GmailAuth, mail)
+		GmailAuth = append(GmailAuth, mailConf)
 	}
 }

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 212
src/main_test.go


+ 0 - 1
src/sogousiteverification.txt

@@ -1 +0,0 @@
-Gik0G8MFPa

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff