renyupeng 2 năm trước cách đây
mục cha
commit
7e7307c3c4
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      Apietl/ruixuan/report/LiveAccountReport.py

+ 6 - 2
Apietl/ruixuan/report/LiveAccountReport.py

@@ -146,7 +146,7 @@ class LiveAccountReport:
                  on user.dept_id=dep.dept_id
                  ) acc_info
              on report.account_id = acc_info.account_id
-        where report.report_date = {start_date} and report.report_date<={end_date}
+        where report.report_date >= {start_date} and report.report_date<={end_date}
           and report.account_id = {account_id};
                         """.format(start_date=start_date, end_date=end_date, account_id=account_id)
         print(sql)
@@ -293,7 +293,7 @@ class LiveAccountReport:
                  on user.dept_id=dep.dept_id
                  ) acc_info
              on report.account_id = acc_info.account_id
-        where report.report_date = {start_date} and report.report_date<={end_date}
+        where report.report_date >= {start_date} and report.report_date<={end_date}
           and report.account_id = {account_id};
                         """.format(start_date=start_date, end_date=end_date, account_id=account_id)
         print(sql)
@@ -313,3 +313,7 @@ class LiveAccountReport:
             self.daily_account(account_id, start_date, end_date)
         else:
             self.account_hourly(account_id, start_date, end_date)
+
+
+if __name__ == '__main__':
+    LiveAccountReport().handler('hourly', 14670026, 20230321, 20230321)