fix: fix balance query (close #138)

This commit is contained in:
JustSong 2023-06-03 10:11:59 +08:00
parent 7e80e2da3a
commit 333e4216d2

View File

@ -73,8 +73,8 @@ func updateChannelBalance(channel *model.Channel) (float64, error) {
} }
now := time.Now() now := time.Now()
startDate := fmt.Sprintf("%s-01", now.Format("2006-01")) startDate := fmt.Sprintf("%s-01", now.Format("2006-01"))
//endDate := now.Format("2006-01-02") endDate := now.Format("2006-01-02")
url = fmt.Sprintf("%s/v1/dashboard/billing/usage?start_date=%s&end_date=%s", baseURL, startDate, "2023-06-01") url = fmt.Sprintf("%s/v1/dashboard/billing/usage?start_date=%s&end_date=%s", baseURL, startDate, endDate)
req, err = http.NewRequest("GET", url, nil) req, err = http.NewRequest("GET", url, nil)
if err != nil { if err != nil {
return 0, err return 0, err