Преглед изворни кода

Merge branch 'edb_data/add_pb_finance' into debug

Roc пре 3 година
родитељ
комит
6fce1bd354
2 измењених фајлова са 19 додато и 2 уклоњено
  1. 2 2
      models/company_view_statistics.go
  2. 17 0
      services/data/edb_info.go

+ 2 - 2
models/company_view_statistics.go

@@ -65,7 +65,7 @@ type CompanyViewTotalSlice struct {
 func GetCompanyViewMobileTotalList(date string) (items []*CompanyViewTotalSlice, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT sum(a.view_num) total,a.date,b.company_id FROM user_view_statistics a join wx_user b on a.mobile=b.mobile 
-WHERE a.mobile != "" and a.date = ? group by company_id`
+WHERE a.mobile != "" and b.mobile != "" and a.date = ? group by company_id`
 	_, err = o.Raw(sql, date).QueryRows(&items)
 	return
 }
@@ -74,7 +74,7 @@ WHERE a.mobile != "" and a.date = ? group by company_id`
 func GetCompanyViewEmailTotalList(date string) (items []*CompanyViewTotalSlice, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT sum(a.view_num) total,a.date,b.company_id FROM user_view_statistics a join wx_user b on a.email=b.email 
-WHERE a.email != "" and a.date = ? group by company_id`
+WHERE a.email != "" and b.email != "" and a.date = ? group by company_id`
 	_, err = o.Raw(sql, date).QueryRows(&items)
 	return
 }

+ 17 - 0
services/data/edb_info.go

@@ -1519,6 +1519,23 @@ func CheckWindDataInterface(cont context.Context) (err error) {
 			}
 		}(hzDataWindUrl)
 	}
+
+	go func() {
+		checkUrl := utils.Hz_Data_WIND_Url + `hz_server`
+		body, err := http.Get(checkUrl)
+		if err != nil {
+			//go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"检测数据接口:失败提醒", "检测路透数据服务器失败:CheckLtDataInterface ErrMsg:"+err.Error(), utils.EmailSendToUsers)
+			msg := "检测Wind数据服务器2失败:CheckWindDataInterface ErrMsg:" + err.Error()
+			go alarm_msg.SendAlarmMsg(msg, 3)
+		} else {
+			result := string(body)
+			if result != `"wind true"` {
+				//go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"检测数据接口:失败提醒", "检测路透数据服务器失败:CheckLtDataInterface ErrMsg:"+string(body), utils.EmailSendToUsers)
+				msg := "检测Wind数据服务器2失败:CheckWindDataInterface ErrMsg:" + string(body)
+				go alarm_msg.SendAlarmMsg(msg, 3)
+			}
+		}
+	}()
 	return
 }