Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/techsneeze/dmarcts-report-viewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjnew-gh <github@hazelden.ca>2021-04-14 21:21:25 +0300
committerjnew-gh <github@hazelden.ca>2021-04-14 21:21:25 +0300
commitd5d15e2e5647493d958d29fd1a974974bdb4f0be (patch)
tree9dd319a13d32753ea10dcf28150d412a678cb917 /dmarcts-report-viewer-report-data.php
parentccfb11927e260f85a8efa26e906b5e9702b24152 (diff)
Simplify SQL statement for Report Description
Don't need such complex SQL statements for generating the Report Data table. This SQL statement simply needs to return the report metadata of one report (to generate the Report Description), not all the report records themselves.
Diffstat (limited to 'dmarcts-report-viewer-report-data.php')
-rw-r--r--dmarcts-report-viewer-report-data.php25
1 files changed, 4 insertions, 21 deletions
diff --git a/dmarcts-report-viewer-report-data.php b/dmarcts-report-viewer-report-data.php
index dca93ca..107e9d1 100644
--- a/dmarcts-report-viewer-report-data.php
+++ b/dmarcts-report-viewer-report-data.php
@@ -292,29 +292,12 @@ switch ($dmarc_select) {
$sql = "
SELECT
- report.*,
- sum(rptrecord.rcount) AS rcount,
- MIN(rptrecord.dkimresult) AS dkimresult,
- MIN(rptrecord.spfresult) AS spfresult
+ *
FROM
report
-LEFT JOIN
- (
- SELECT
- rcount,
- COALESCE(dkimresult, 'neutral') AS dkimresult,
- COALESCE(spfresult, 'neutral') AS spfresult,
- serial
- FROM
- rptrecord
- )
- AS rptrecord
-ON
- report.serial = rptrecord.serial
-WHERE report.serial = " . $mysqli->real_escape_string($reportid) . "
-GROUP BY serial
-ORDER BY mindate $sort, maxdate $sort , org";
-
+WHERE
+ serial = " . $mysqli->real_escape_string($reportid)
+;
// Debug
// echo "<br /><b>Data Report sql:</b> $sql<br />";