|
@@ -7,6 +7,7 @@ import (
|
7
|
7
|
"time"
|
8
|
8
|
|
9
|
9
|
"github.com/astaxie/beego"
|
|
10
|
+ "github.com/astaxie/beego/config"
|
10
|
11
|
)
|
11
|
12
|
|
12
|
13
|
func InitTask() {
|
|
@@ -23,6 +24,10 @@ func SendMessageToCustomer() time.Duration {
|
23
|
24
|
CaseName string
|
24
|
25
|
Openid string
|
25
|
26
|
}
|
|
27
|
+ appRoot := utils.GetAppRoot()
|
|
28
|
+ wechatconf, _ := config.NewConfig("ini", appRoot+"/conf/wechat.conf")
|
|
29
|
+ week := wechatconf.String("bookReturnAlertTplID")
|
|
30
|
+ late := wechatconf.String("bookLateAlertTplID")
|
26
|
31
|
var weekList []TimeRecordList
|
27
|
32
|
sql := `SELECT
|
28
|
33
|
a.*,
|
|
@@ -64,7 +69,7 @@ WHERE
|
64
|
69
|
To: utils.ClientID{ID: weekList[i].Openid},
|
65
|
70
|
Data: map[string]interface{}{
|
66
|
71
|
"orgid": weekList[i].OrgId,
|
67
|
|
- "tplid": "6WoxRkdXrRyF0T7Kc4PU5CjkpzAPWKKsA6wBLAGSQQg",
|
|
72
|
+ "tplid": week,
|
68
|
73
|
"link": "",
|
69
|
74
|
"data": map[string]string{
|
70
|
75
|
"first": "您好,您借阅图书即将逾期,请及时归还。",
|
|
@@ -90,7 +95,7 @@ WHERE
|
90
|
95
|
To: utils.ClientID{ID: lateList[i].Openid},
|
91
|
96
|
Data: map[string]interface{}{
|
92
|
97
|
"orgid": lateList[i].OrgId,
|
93
|
|
- "tplid": "ID:Be0a25NMb3fzLtNaaQn_YOuECQDnlCs1es5aVvfwRhs",
|
|
98
|
+ "tplid": late,
|
94
|
99
|
"link": "",
|
95
|
100
|
"data": map[string]string{
|
96
|
101
|
"first": "您好,您借阅图书的时间已经逾期2天",
|