Line 55... |
Line 55... |
55 |
|
55 |
|
56 |
# This query properly handles calls that span from the
|
56 |
# This query properly handles calls that span from the
|
57 |
# previous reset period into the current period but
|
57 |
# previous reset period into the current period but
|
58 |
# involves more work for the SQL server than those
|
58 |
# involves more work for the SQL server than those
|
59 |
# below
|
59 |
# below
|
- |
|
60 |
|
- |
|
61 |
# Ancienne requete
|
60 |
query = "SELECT SUM(acctsessiontime - \
|
62 |
# query = "SELECT SUM(acctsessiontime - \
|
61 |
GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
|
63 |
# GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
|
62 |
FROM radacct WHERE username = '%{${key}}' AND \
|
64 |
# FROM radacct WHERE username = '%{${key}}' AND \
|
63 |
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
|
65 |
# UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
|
- |
|
66 |
|
- |
|
67 |
|
- |
|
68 |
# Requete modifiée
|
- |
|
69 |
query = "SELECT IFNULL((SELECT SUM(acctsessiontime - \
|
- |
|
70 |
GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)),0)) \
|
- |
|
71 |
FROM radacct WHERE username = '%{${key}}' AND \
|
- |
|
72 |
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'),0)"
|
- |
|
73 |
|
64 |
|
74 |
|
65 |
# This query ignores calls that started in a previous
|
75 |
# This query ignores calls that started in a previous
|
66 |
# reset period and continue into into this one. But it
|
76 |
# reset period and continue into into this one. But it
|
67 |
# is a little easier on the SQL server
|
77 |
# is a little easier on the SQL server
|
68 |
# query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \
|
78 |
# query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \
|
Line 86... |
Line 96... |
86 |
|
96 |
|
87 |
# This query properly handles calls that span from the
|
97 |
# This query properly handles calls that span from the
|
88 |
# previous reset period into the current period but
|
98 |
# previous reset period into the current period but
|
89 |
# involves more work for the SQL server than those
|
99 |
# involves more work for the SQL server than those
|
90 |
# below
|
100 |
# below
|
- |
|
101 |
|
- |
|
102 |
|
- |
|
103 |
# Ancienne requete
|
91 |
query = "SELECT SUM(acctsessiontime - \
|
104 |
# query = "SELECT SUM(acctsessiontime - \
|
- |
|
105 |
# GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
|
- |
|
106 |
# FROM radacct WHERE username='%{${key}}' AND \
|
- |
|
107 |
# UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
|
- |
|
108 |
|
- |
|
109 |
|
- |
|
110 |
# Requete modifiée
|
- |
|
111 |
query = "SELECT IFNULL((SELECT SUM(acctsessiontime - \
|
92 |
GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
|
112 |
GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \
|
93 |
FROM radacct WHERE username='%{${key}}' AND \
|
113 |
FROM radacct WHERE username='%{${key}}' AND \
|
94 |
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"
|
114 |
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'),0)"
|
- |
|
115 |
|
95 |
|
116 |
|
96 |
# This query ignores calls that started in a previous
|
117 |
# This query ignores calls that started in a previous
|
97 |
# reset period and continue into into this one. But it
|
118 |
# reset period and continue into into this one. But it
|
98 |
# is a little easier on the SQL server
|
119 |
# is a little easier on the SQL server
|
99 |
# query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \
|
120 |
# query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \
|