|
6 | 6 | $having = array( true, true, true, false, false, false, false, false, false );
|
7 | 7 |
|
8 | 8 | $query = 'SELECT SQL_CALC_FOUND_ROWS ';
|
9 |
| - $query .= ' review.checksum AS checksum,'; |
10 |
| - $query .= ' review.fingerprint AS fingerprint,'; |
11 |
| - $query .= " IFNULL(review.reviewed_by, '') AS reviewed_by,"; |
12 |
| - $query .= ' DATE(review.reviewed_on) AS reviewed_on,'; |
13 |
| - $query .= ' review.comments AS comments,'; |
| 9 | + $query .= ' review.checksum AS checksum,'; |
| 10 | + $query .= ' review.fingerprint AS fingerprint,'; |
| 11 | + $query .= " IFNULL(review.reviewed_by, '') AS reviewed_by,"; |
| 12 | + $query .= ' DATE(review.reviewed_on) AS reviewed_on,'; |
| 13 | + $query .= ' review.comments AS comments,'; |
14 | 14 | if (strlen($reviewhost['history_table'])) {
|
15 |
| - $query .= ' DATE(MIN(history.ts_min)) AS first_seen,'; |
16 |
| - $query .= ' DATE(MAX(history.ts_max)) AS last_seen,'; |
17 |
| - $query .= ' SUM(history.ts_cnt) AS `count`,'; |
18 |
| - $query .= ' ROUND(SUM(history.query_time_sum), 2)*1000 AS `time`,'; |
19 |
| - $query .= ' ROUND(SUM(history.query_time_sum)*1000/SUM(history.ts_cnt), 2) AS time_avg'; |
20 |
| - $query .= ' FROM '.Database::escapeField($reviewhost['review_table']).' AS review'; |
21 |
| - $query .= ' JOIN '.Database::escapeField($reviewhost['history_table']).' AS history'; |
| 15 | + $query .= ' DATE(MIN(history.ts_min)) AS first_seen,'; |
| 16 | + $query .= ' DATE(MAX(history.ts_max)) AS last_seen,'; |
| 17 | + $query .= ' SUM(history.ts_cnt) AS `count`,'; |
| 18 | + $query .= ' ROUND(SUM(history.query_time_sum), 2)*1000 AS `time`,'; |
| 19 | + $query .= ' ROUND(SUM(history.query_time_sum)*1000/SUM(history.ts_cnt), 2) AS time_avg'; |
| 20 | + $query .= ' FROM '.Database::escapeField($reviewhost['review_table']).' AS review'; |
| 21 | + $query .= ' JOIN '.Database::escapeField($reviewhost['history_table']).' AS history'; |
22 | 22 | $query .= ' ON history.checksum = review.checksum';
|
23 | 23 | }
|
24 | 24 | else {
|
25 |
| - $query .= ' DATE(review.first_seen) AS first_seen,'; |
26 |
| - $query .= ' DATE(review.last_seen) AS last_seen,'; |
27 |
| - $query .= ' 0 AS `count`,'; |
28 |
| - $query .= ' 0 AS `time`,'; |
29 |
| - $query .= ' 0 AS time_avg'; |
30 |
| - $query .= ' FROM '.$reviewhost['review_table'].' AS review'; |
| 25 | + $query .= ' DATE(review.first_seen) AS first_seen,'; |
| 26 | + $query .= ' DATE(review.last_seen) AS last_seen,'; |
| 27 | + $query .= ' 0 AS `count`,'; |
| 28 | + $query .= ' 0 AS `time`,'; |
| 29 | + $query .= ' 0 AS time_avg'; |
| 30 | + $query .= ' FROM '.$reviewhost['review_table'].' AS review'; |
31 | 31 | }
|
32 | 32 |
|
33 | 33 | $sWhere = "";
|
|
0 commit comments