@@ -160,8 +160,8 @@ func daily() {
160160 <- time .After (dur )
161161 last0 := time .Date (now .Year (), now .Month (), now .Day (), 0 ,0 ,0 ,0 , now .Location ())
162162 // 开始执行 0 点任务
163- btcrep := calc ("btc" , last0 .Unix ())
164- usdtrep := calc ("usdt" , last0 .Unix ())
163+ btcrep := calc ("btc" , last0 .Unix (), 5000000 ) // 500w$ 才会打印
164+ usdtrep := calc ("usdt" , last0 .Unix (), 5000000 )
165165 btcrep .Time = "#日报"
166166 usdtrep .Time = "#日报"
167167 doReport (btcrep )
@@ -170,8 +170,8 @@ func daily() {
170170 t := time .Now ()
171171 if t .Weekday () == 0 { // 一周任务
172172 nt := t .AddDate (0 ,0 ,- 7 )
173- btcrep := calc ("btc" , nt .Unix ())
174- usdtrep := calc ("usdt" , nt .Unix ())
173+ btcrep := calc ("btc" , nt .Unix (), 25000000 )
174+ usdtrep := calc ("usdt" , nt .Unix (), 25000000 )
175175 btcrep .Time = "#周报"
176176 usdtrep .Time = "#周报"
177177 doReport (btcrep )
@@ -197,7 +197,7 @@ func doReport(rep *report) {
197197}
198198
199199// 统计币种情况, 不会返回 nil
200- func calc (currency string , timestamp int64 ) * report {
200+ func calc (currency string , timestamp int64 , minVal int64 ) * report {
201201 re := & report {
202202 Name : currency ,
203203 Data : make (map [string ]* reportData ),
@@ -241,7 +241,12 @@ func calc(currency string, timestamp int64) *report{
241241 re .IN_usd += alert .AmountUsd // 流入交易所
242242 }
243243 }
244-
244+ }
245+ // 交易额小于 minVal 美元的不显示
246+ for k ,v := range re .Data {
247+ if v .TotalIn_usd + v .TotalOut_usd < minVal {
248+ delete (re .Data , k )
249+ }
245250 }
246251 return re
247252}
0 commit comments