Refactor MySQL database specific SQL
This commit is contained in:
parent
2b4802508d
commit
cb65d25cfc
6
templates/queries-call_for_shows-mysql.tpl.html
Normal file
6
templates/queries-call_for_shows-mysql.tpl.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<!--% query_call_for_shows = '
|
||||||
|
SELECT CASE WHEN COUNT(id) < 7 THEN True ELSE False END AS `request_for_shows`
|
||||||
|
FROM eps
|
||||||
|
WHERE eps.date > NOW() AND eps.date < DATE_ADD(NOW(), INTERVAL 10 DAY)
|
||||||
|
'
|
||||||
|
%-->
|
6
templates/queries-call_for_shows-sqlite.tpl.html
Normal file
6
templates/queries-call_for_shows-sqlite.tpl.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<!--% query_call_for_shows = '
|
||||||
|
SELECT CASE WHEN COUNT(id) < 7 THEN True ELSE False END AS `request_for_shows`
|
||||||
|
FROM eps
|
||||||
|
WHERE eps.date > date(\'now\') AND eps.date < date(\'now\', \'+10 days\')
|
||||||
|
'
|
||||||
|
%-->
|
@ -1,12 +1,9 @@
|
|||||||
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
<!--% PROCESS 'shared-utils.tpl.html' %-->
|
||||||
|
<!--% PROCESS "queries-call_for_shows-${constants.database}.tpl.html" %-->
|
||||||
<!--% MACRO display_call_for_shows BLOCK %-->
|
<!--% MACRO display_call_for_shows BLOCK %-->
|
||||||
<!--% query_call_for_shows = DBI.prepare('
|
<!--% result_call_for_shows = DBI.prepare(query_call_for_shows)
|
||||||
SELECT CASE WHEN COUNT(id) < 7 THEN True ELSE False END AS `request_for_shows`
|
|
||||||
FROM eps
|
|
||||||
WHERE eps.date > date(\'now\') AND eps.date < date(\'now\', \'+10 days\')
|
|
||||||
')
|
|
||||||
%-->
|
%-->
|
||||||
<!--% results_call_for_shows = query_call_for_shows.execute().get_all() %-->
|
<!--% results_call_for_shows = result_call_for_shows.execute().get_all() %-->
|
||||||
<!--% IF results_call_for_shows.0.request_for_shows == 1 %-->
|
<!--% IF results_call_for_shows.0.request_for_shows == 1 %-->
|
||||||
<!--% USE date %-->
|
<!--% USE date %-->
|
||||||
<article>
|
<article>
|
||||||
|
Loading…
Reference in New Issue
Block a user