forked from verdnatura/hedera-web
Visits SQL FK refactor
This commit is contained in:
parent
1bbe94385b
commit
7329310f1f
|
@ -1,4 +1,4 @@
|
|||
hedera-web (1.406.57) stable; urgency=low
|
||||
hedera-web (1.406.58) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
<custom>
|
||||
SELECT u.stamp, a.platform, a.browser, a.version, a.javascript, a.cookies
|
||||
FROM visitUser u
|
||||
JOIN visitAccess c ON c.id = u.access
|
||||
JOIN visitAgent a ON a.id = c.agent
|
||||
WHERE u.user = #user
|
||||
JOIN visitAccess c ON c.id = u.accessFk
|
||||
JOIN visitAgent a ON a.id = c.agentFk
|
||||
WHERE u.userFk = #user
|
||||
ORDER BY u.stamp DESC
|
||||
LIMIT 8
|
||||
</custom>
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
<htk-repeater form-id="iter">
|
||||
<db-model property="model" id="sessions" on-status-changed="onModelStatusChange">
|
||||
<custom>
|
||||
SELECT vu.user userId, vu.stamp, u.nickname, s.lastUpdate,
|
||||
SELECT vu.userFk userId, vu.stamp, u.nickname, s.lastUpdate,
|
||||
a.platform, a.browser, a.version, u.name user
|
||||
FROM userSession s
|
||||
JOIN visitUser vu ON vu.id = s.userVisit
|
||||
JOIN visitAccess ac ON ac.id = vu.access
|
||||
JOIN visitAgent a ON a.id = ac.agent
|
||||
JOIN visit v ON v.id = a.visit
|
||||
JOIN account.user u ON u.id = vu.user
|
||||
JOIN visitUser vu ON vu.id = s.userVisitFk
|
||||
JOIN visitAccess ac ON ac.id = vu.accessFk
|
||||
JOIN visitAgent a ON a.id = ac.agentFk
|
||||
JOIN visit v ON v.id = a.visitFk
|
||||
JOIN account.user u ON u.id = vu.userFk
|
||||
ORDER BY lastUpdate DESC
|
||||
</custom>
|
||||
</db-model>
|
||||
|
|
|
@ -51,18 +51,18 @@
|
|||
<htk-repeater form-id="iter" empty-message="_Select date interval">
|
||||
<db-model property="model" id="visits">
|
||||
<custom>
|
||||
SELECT browser
|
||||
,MIN(CAST(version AS DECIMAL(4,1))) minVersion
|
||||
,MAX(CAST(version AS DECIMAL(4,1))) maxVersion
|
||||
,MAX(c.stamp) lastVisit
|
||||
,COUNT(DISTINCT c.id) visits
|
||||
,SUM(a.firstAccess = c.id AND v.firstAgent = a.id) newVisits
|
||||
SELECT browser,
|
||||
MIN(CAST(version AS DECIMAL(4,1))) minVersion,
|
||||
MAX(CAST(version AS DECIMAL(4,1))) maxVersion,
|
||||
MAX(c.stamp) lastVisit,
|
||||
COUNT(DISTINCT c.id) visits,
|
||||
SUM(a.firstAccessFk = c.id AND v.firstAgentFk = a.id) newVisits
|
||||
FROM visitUser e
|
||||
JOIN visitAccess c ON e.access = c.id
|
||||
JOIN visitAgent a ON c.agent = a.id
|
||||
JOIN visit v ON a.visit = v.id
|
||||
WHERE c.stamp BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59')
|
||||
GROUP BY browser ORDER BY visits DESC
|
||||
JOIN visitAccess c ON c.id = e.accessFk
|
||||
JOIN visitAgent a ON a.id = c.agentFk
|
||||
JOIN visit v ON v.id = a.visitFk
|
||||
WHERE c.stamp BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59')
|
||||
GROUP BY browser ORDER BY visits DESC
|
||||
</custom>
|
||||
<sql-batch property="batch">
|
||||
<custom>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hedera-web",
|
||||
"version": "1.406.57",
|
||||
"version": "1.406.58",
|
||||
"description": "Verdnatura web page",
|
||||
"license": "GPL-3.0",
|
||||
"repository": {
|
||||
|
|
Loading…
Reference in New Issue