mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
Modify collections filter & add JOIN on log_colls table
Create entries in log_colls table Fix SQL issue Fix SQL issues Update version Add patch Remove debug output Fix CS Fic CS Add table schema Fix Cs Update patch Update patch Update patch Update patch Update patch delete all coll_list call Fix logger issue Fix log_colls table structure definition Rename patch Fix SQL Issues Fix patch Fix test Fix tests
This commit is contained in:
@@ -33,21 +33,19 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
|
||||
$this->params = $params;
|
||||
|
||||
if ($this->groupby == false) {
|
||||
$this->sql =
|
||||
"
|
||||
SELECT
|
||||
log_search.date ddate,
|
||||
search,
|
||||
usrid,
|
||||
user,
|
||||
pays,
|
||||
societe,
|
||||
activite,
|
||||
fonction
|
||||
FROM `log_search`
|
||||
INNER JOIN log
|
||||
ON log.id = log_search.log_id
|
||||
";
|
||||
$this->sql ="
|
||||
SELECT
|
||||
log_search.date ddate,
|
||||
search,
|
||||
usrid,
|
||||
user,
|
||||
pays,
|
||||
societe,
|
||||
activite,
|
||||
fonction
|
||||
FROM (`log_search`)
|
||||
INNER JOIN log ON (log.id = log_search.log_id)
|
||||
INNER JOIN log_colls ON (log.id = log_colls.log_id)";
|
||||
|
||||
$this->sql .= " WHERE " . $report_filter['sql'];
|
||||
|
||||
@@ -61,13 +59,13 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
|
||||
$this->sql .= $this->filter->getLimitFilter() ? : '';
|
||||
} else {
|
||||
$this->sql = "
|
||||
SELECT
|
||||
TRIM(" . $this->getTransQuery($this->groupby) . ") as " . $this->groupby . ",
|
||||
SUM(1) as nb
|
||||
FROM `log_search`
|
||||
INNER JOIN log
|
||||
ON log.id = log_search.log_id
|
||||
";
|
||||
SELECT
|
||||
TRIM(" . $this->getTransQuery($this->groupby) . ") as " . $this->groupby . ",
|
||||
SUM(1) as nb
|
||||
FROM (`log_search`)
|
||||
INNER JOIN log ON (log.id = log_search.log_id)
|
||||
INNER JOIN log_colls ON (log.id = log_colls.log_id)
|
||||
";
|
||||
|
||||
$this->sql .= " WHERE " . $report_filter['sql'];
|
||||
$this->sql .= " GROUP BY " . $this->groupby;
|
||||
@@ -90,9 +88,9 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
|
||||
|
||||
$sql = "
|
||||
SELECT DISTINCT(" . $this->getTransQuery($field) . ") as val
|
||||
FROM `log_search`
|
||||
INNER JOIN log
|
||||
ON log.id = log_search.log_id
|
||||
FROM (`log_search`)
|
||||
INNER JOIN log ON (log.id = log_search.log_id)
|
||||
INNER JOIN log_colls ON (log.id = log_colls.log_id)
|
||||
";
|
||||
|
||||
if ($report_filter['sql'])
|
||||
|
Reference in New Issue
Block a user