瀏覽代碼

修改随手办公日志文件

longyu 3 年之前
父節點
當前提交
54b37f39d3
共有 3 個文件被更改,包括 8 次插入6 次删除
  1. 2 2
      models/roadshow/calendar.go
  2. 5 3
      services/wechat_send_msg.go
  3. 1 1
      utils/logs.go

+ 2 - 2
models/roadshow/calendar.go

@@ -170,9 +170,9 @@ func GetCalendarList(condition string, pars []interface{}, status int, pageLimit
 		sql += condition
 	}
 	if status == 1 {
-		sql += ` ORDER BY a.create_time ASC LIMIT ?,? `
+		sql += ` ORDER BY b.create_time ASC LIMIT ?,? `
 	} else {
-		sql += ` ORDER BY a.create_time DESC LIMIT ?,? `
+		sql += ` ORDER BY b.create_time DESC LIMIT ?,? `
 	}
 	_, err = o.Raw(sql, pars, pageLimit).QueryRows(&list)
 	return

+ 5 - 3
services/wechat_send_msg.go

@@ -102,7 +102,7 @@ func sendTemplateMsg(sendUrl string, sendMap map[string]interface{}, items []*wx
 }
 
 func toSendTemplateMsg(sendUrl string, data []byte) (err error) {
-	utils.FileLog.Info("Send:%s", string(data))
+	utils.FileLog.Info("Send:"+string(data))
 	client := http.Client{}
 	resp, err := client.Post(sendUrl, "application/json", bytes.NewBuffer(data))
 	if err != nil {
@@ -111,7 +111,7 @@ func toSendTemplateMsg(sendUrl string, data []byte) (err error) {
 	defer resp.Body.Close()
 
 	body, _ := ioutil.ReadAll(resp.Body)
-	utils.FileLog.Info("SendResult:%s", string(body))
+	utils.FileLog.Info("SendResult:"+string(body))
 	var templateResponse SendTemplateResponse
 	err = json.Unmarshal(body, &templateResponse)
 	if err != nil {
@@ -277,7 +277,7 @@ func SendWxMsgWithRoadshowPending(first, keyword1, keyword2, keyword3, keyword4,
 	defer func() {
 		if err != nil {
 			go utils.SendEmail("发送模版消息失败"+time.Now().Format("2006-01-02 15:04:05"), msg+";Err:"+err.Error(), utils.EmailSendToUsers)
-			utils.FileLog.Info("发送模版消息失败,Err:%s,%s", err.Error(), msg)
+			utils.FileLog.Info("发送模版消息失败,Err:"+err.Error()+msg)
 		}
 		if msg != "" {
 			utils.FileLog.Info("发送模版消息失败,msg:%s", msg)
@@ -321,6 +321,7 @@ func SendWxMsgWithRoadshowPending(first, keyword1, keyword2, keyword3, keyword4,
 		sendData["remark"] = map[string]interface{}{"value": remark, "color": "#173177"}
 
 		sendMap["template_id"] = utils.WxMsgTemplateIdWithRoadshowPending
+		sendMap["data"] = sendData
 		//小程序信息
 		if wxAppPath != "" {
 			sendMap["miniprogram"] = map[string]interface{}{"appid": utils.WxAppId2, "pagepath": wxAppPath}
@@ -380,6 +381,7 @@ func SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppP
 		if wxAppPath != "" {
 			sendMap["miniprogram"] = map[string]interface{}{"appid": utils.WxAppId2, "pagepath": wxAppPath}
 		}
+		sendMap["data"] = sendData
 		sendTemplateMsg(sendUrl, sendMap, openIdList)
 	}
 	utils.FileLog.Info("send end")

+ 1 - 1
utils/logs.go

@@ -8,5 +8,5 @@ var FileLog *logs.BeeLogger
 
 func init() {
 	FileLog = logs.NewLogger(1000000)
-	FileLog.SetLogger(logs.AdapterFile, `{"filename":"./rdlucklog/hongze_task.log"}`)
+	FileLog.SetLogger(logs.AdapterFile, `{"filename":"./rdlucklog/hongze_mobile_admin.log"}`)
 }