Clean up unused files
This commit is contained in:
parent
450cc76d13
commit
8cbc1497c9
|
@ -1,44 +0,0 @@
|
||||||
SELECT
|
|
||||||
posts.id,
|
|
||||||
posts.post_title,
|
|
||||||
authors.name,
|
|
||||||
posts.post_time
|
|
||||||
FROM
|
|
||||||
posts,authors
|
|
||||||
WHERE
|
|
||||||
authors.id = posts.authorid
|
|
||||||
<% print("reqult:",result) -%>
|
|
||||||
<% for field, values in pairs(result) do -%>
|
|
||||||
<% print("values:",values) -%>
|
|
||||||
<% for _,value in pairs(values) do -%>
|
|
||||||
<% local pn,expr,value = unpack(value) -%>
|
|
||||||
<% local n = (pn == "+" and "" or "NOT") -%>
|
|
||||||
<% if field == "title" then -%>
|
|
||||||
AND <%= n %> posts.post_title LIKE ?
|
|
||||||
<% elseif field == "author" then -%>
|
|
||||||
AND <%= n %> authors.name LIKE ?
|
|
||||||
<% elseif field == "date" then -%>
|
|
||||||
AND <%= n %> posts.post_time <%- expr %> ?
|
|
||||||
<% elseif field == "hits" then -%>
|
|
||||||
AND posts.views <%- expr -%> ?
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
||||||
<% end -%>
|
|
||||||
<% print("tags:",result.tags) %>
|
|
||||||
<% for _,tag in pairs(result.tags) do -%>
|
|
||||||
INTERSECT
|
|
||||||
SELECT
|
|
||||||
posts.id,
|
|
||||||
posts.post_title,
|
|
||||||
authors.name,
|
|
||||||
posts.post_time
|
|
||||||
FROM
|
|
||||||
posts,authors,tags
|
|
||||||
WHERE
|
|
||||||
posts.authorid = authors.id
|
|
||||||
AND tags.postid = posts.id
|
|
||||||
<% local n,v = unpack(tag) -%>
|
|
||||||
<% n = (n == "-" and "NOT" or "") -%>
|
|
||||||
AND <%= n %> tags.tag = <%= v %>
|
|
||||||
<% end -%>
|
|
||||||
;
|
|
Loading…
Reference in New Issue