Refactor MySQL database specific SQL
This commit is contained in:
parent
6f28bb2a16
commit
675f8fa9d5
@ -1,4 +1,5 @@
|
|||||||
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
|
<!--% PROCESS 'shared-episode-summary.tpl.html' %-->
|
||||||
|
<!--% PROCESS "queries-episodes-${constants.database}.tpl.html" %-->
|
||||||
<article>
|
<article>
|
||||||
<header>
|
<header>
|
||||||
<h1>Complete Archive of Shows.</h1>
|
<h1>Complete Archive of Shows.</h1>
|
||||||
@ -7,21 +8,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
<!--% USE DBI(constants.driver, constants.user, constants.password) %-->
|
||||||
<!--% FOREACH episodes IN DBI.query('
|
<!--% FOREACH episodes IN DBI.query(query_episodes)
|
||||||
SELECT
|
|
||||||
eps.id,
|
|
||||||
eps.explicit,
|
|
||||||
eps.date, eps.license, eps.title, eps.summary,
|
|
||||||
eps.duration, eps.notes, eps.tags,
|
|
||||||
hosts.hostid,
|
|
||||||
hosts.host, hosts.email, hosts.local_image,
|
|
||||||
miniseries.name AS series, miniseries.id AS seriesid
|
|
||||||
FROM eps
|
|
||||||
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
|
||||||
INNER JOIN miniseries ON eps.series = miniseries.id
|
|
||||||
WHERE eps.date < DATE_ADD(NOW(), INTERVAL 1 DAY)
|
|
||||||
ORDER BY eps.id DESC
|
|
||||||
')
|
|
||||||
%-->
|
%-->
|
||||||
<!--% show_summary(episodes) %-->
|
<!--% show_summary(episodes) %-->
|
||||||
<!--% END %-->
|
<!--% END %-->
|
||||||
|
15
templates/queries-episodes-mysql.tpl.html
Normal file
15
templates/queries-episodes-mysql.tpl.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!--% query_episodes = 'SELECT
|
||||||
|
eps.id,
|
||||||
|
eps.explicit,
|
||||||
|
eps.date, eps.license, eps.title, eps.summary,
|
||||||
|
eps.duration, eps.notes, eps.tags,
|
||||||
|
hosts.hostid,
|
||||||
|
hosts.host, hosts.email, hosts.local_image,
|
||||||
|
miniseries.name AS series, miniseries.id AS seriesid
|
||||||
|
FROM eps
|
||||||
|
INNER JOIN hosts ON eps.hostid = hosts.hostid
|
||||||
|
INNER JOIN miniseries ON eps.series = miniseries.id
|
||||||
|
WHERE eps.date < DATE_ADD(NOW(), INTERVAL 1 DAY)
|
||||||
|
ORDER BY eps.id DESC'
|
||||||
|
%-->
|
||||||
|
|
Reference in New Issue
Block a user