Browse Source

模板消息自定义

wangchuanjin 4 years ago
parent
commit
b8f1f6a844

+ 8 - 8
src/jfw/modules/subscribepay/src/config.json

@@ -1,16 +1,16 @@
 {
-	"mongodbServers": "192.168.3.206:27080",
+	"mongodbServers": "127.0.0.1:17080",
     "mongodbPoolSize": 5,
     "mongodbName": "qfw",
     "mongoent":{
-    	"address": "192.168.3.207:27001,192.168.3.206:27002",
+    	"address": "127.0.0.1:27001,127.0.0.1:27002",
 		"size": 5,
 		"dbName": "qfw_data",
 		"userName": "jyDevGroup",
 		"password": "jy@DevGroup"
     },
 	"mongobidding":{
-		"address": "192.168.3.207:27001,192.168.3.206:27002",
+		"address": "127.0.0.1:27001,127.0.0.1:27002",
 		"size": 5,
 		"dbName": "qfw_data",
 		"replSet": "",
@@ -20,15 +20,15 @@
 		"password": "jy@DevGroup"
 	},
 	"mongolog": {
-		"address": "192.168.3.206:27090",
+		"address": "127.0.0.1:17090",
  		"size": 5,
  		"dbName": "qfw",
 		"replSet": "",
 		"userName": "admin",
 		"password": "123456"
 	},
-    "redisaddrs": "other=192.168.3.11:1712,session=192.168.3.11:1713,push=192.168.3.206:1712,pushcache_1=192.168.3.206:5000,pushcache_2_a=192.168.3.206:5001",
-    "elasticsearch": "http://192.168.3.206:9800",
+    "redisaddrs": "other=127.0.0.1:1712,session=127.0.0.1:1713,push=127.0.0.1:1712,pushcache_1=127.0.0.1:5000,pushcache_2_a=127.0.0.1:5001",
+    "elasticsearch": "http://127.0.0.1:1800",
     "elasticPoolSize": 30,
     "appid": "wx5b1c6e7cc4dac0e4",
     "appsecret": "b026103ffebd2291b3edb7a269612112",
@@ -37,7 +37,7 @@
     "weixinrpc": "127.0.0.1:8083",
     "mysql": {
         "dbName": "jianyu",
-        "address": "192.168.3.11:3366",
+        "address": "127.0.0.1:1366",
         "userName": "root",
         "passWord": "Topnet123",
 		"maxOpenConns":500,
@@ -45,7 +45,7 @@
 		},
   "pushMysql": {
     "dbName": "jianyu",
-    "address": "192.168.3.11:3366",
+    "address": "127.0.0.1:1366",
     "userName": "root",
     "passWord": "Topnet123",
     "maxOpenConns": 2000,

+ 3 - 1
src/jfw/modules/subscribepay/src/main.go

@@ -16,7 +16,7 @@ import (
 	"github.com/go-xweb/xweb"
 )
 
-func main() {
+func init() {
 	wxTplMsgExpiredErr := (&util.WxTplMsgCustom{}).Expired()
 	if wxTplMsgExpiredErr != nil {
 		log.Fatalln(wxTplMsgExpiredErr)
@@ -25,6 +25,8 @@ func main() {
 	if wxTplMsgDataReportErr != nil {
 		log.Fatalln(wxTplMsgDataReportErr)
 	}
+}
+func main() {
 	go func() {
 		frpc := new(rpcfollow.JyPayRpc)
 		rpc.Register(frpc)

+ 2 - 2
src/jfw/modules/subscribepay/src/util/wxtplmsgcustom.go

@@ -24,7 +24,7 @@ func (w *WxTplMsgCustom) Get(tplId string, sceneCode ...string) map[string]*Tmpl
 		wh = append(wh, "?")
 	}
 	list := Mysql.SelectBySql(`select firstdata,sceneCode from scene a 
-	inner join template_message b on (a.templateId=b.id and b.id=? and a.sceneCode in (`+strings.Join(wh, ",")+`) and a.state=1 and b.isTest=1)`, param...)
+	inner join template_message b on (a.templateId=b.id and b.templateId=? and a.sceneCode in (`+strings.Join(wh, ",")+`) and a.state=1 and a.isTest=1)`, param...)
 	m := map[string]*TmplItem{}
 	if list != nil {
 		for _, v := range *list {
@@ -92,6 +92,6 @@ func (w *WxTplMsgCustom) DataReport() error {
 		return errors.New("数据报告,微信模板消息first_data为空")
 	}
 	MessageConfig.WxTpl_DataReport.First.Value = wxTplMsg[WxTpl_DataReport_SceneCode].Value
-	log.Println("微信模板消息first_data", wxTplMsg[WxTpl_DataReport_SceneCode].Value)
+	log.Println("数据报告,微信模板消息first_data", wxTplMsg[WxTpl_DataReport_SceneCode].Value)
 	return nil
 }