Browse Source

fix-3578

fix-3578
liuzx 2 years ago
parent
commit
15aadc3193
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      models/cloudbrain_static.go

+ 1
- 1
models/cloudbrain_static.go View File

@@ -247,7 +247,7 @@ func getCreatePeriodCount(dateBeginTime string, dateEndTime string, hourBeginTim
func getRunPeriodCount(dateBeginTime string, dateEndTime string, hourBeginTime string, hourEndTime string) (int64, error) { func getRunPeriodCount(dateBeginTime string, dateEndTime string, hourBeginTime string, hourEndTime string) (int64, error) {
countSql := "SELECT count(*) FROM " + countSql := "SELECT count(*) FROM " +
"public.cloudbrain where not ((to_char(to_timestamp(start_time), ' HH24:MI:SS') > '" + hourEndTime + "public.cloudbrain where not ((to_char(to_timestamp(start_time), ' HH24:MI:SS') > '" + hourEndTime +
"') or (to_char(to_timestamp(end_time), 'HH24:MI:SS') < '" + hourBeginTime + "'))" +
"') or (to_char(to_timestamp(COALESCE(end_time,EXTRACT(epoch FROM now()))), 'HH24:MI:SS') < '" + hourBeginTime + "'))" +
" and (to_char(to_timestamp(start_time), 'YYYY-MM-DD') >= '" + dateBeginTime + " and (to_char(to_timestamp(start_time), 'YYYY-MM-DD') >= '" + dateBeginTime +
"' and to_char(to_timestamp(start_time), 'YYYY-MM-DD') < '" + dateEndTime + "')" "' and to_char(to_timestamp(start_time), 'YYYY-MM-DD') < '" + dateEndTime + "')"
return x.SQL(countSql).Count() return x.SQL(countSql).Count()


Loading…
Cancel
Save