CMS静态化后的动态数据刷新
This commit is contained in:
@@ -21,14 +21,19 @@
|
||||
</select>
|
||||
|
||||
<update id="updateExpiredWeight">
|
||||
update ${_prefix}cms_article SET weight = 0
|
||||
UPDATE ${_prefix}cms_article SET weight = 0
|
||||
WHERE weight > 0 AND weight_date < #{weightDate}
|
||||
</update>
|
||||
|
||||
<update id="updateHitsAddOne">
|
||||
update ${_prefix}cms_article set
|
||||
UPDATE ${_prefix}cms_article SET
|
||||
hits = hits + 1
|
||||
WHERE id = #{id}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getHits" resultType="long">
|
||||
SELECT hits FROM ${_prefix}cms_article
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -13,4 +13,4 @@
|
||||
</div>
|
||||
</footer>
|
||||
<script src="${ctxStatic}/modules/cmsfront/themes/js/bootstrap.min.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/modules/cmsfront/themes/js/custom.js?${_version}"></script>
|
||||
<script src="${ctxStatic}/modules/cmsfront/themes/js/custom.js?${_version}"></script>
|
||||
@@ -21,7 +21,7 @@
|
||||
<ul class="article-list">
|
||||
<#html:foreach items="${articleList(site.siteCode, category.categoryCode, 5)}" var="article,status">
|
||||
<li>${status.index}. <span class="pull-right">${article.updateDate,'yyyy-MM-dd'}</span>
|
||||
<a href="${article.url}" style="color:${article.color}">${abbr(article.title,28)}</a> </li>
|
||||
<a href="${article.url}" style="color:${article.color}">${abbr(article.title,28)}</a></li>
|
||||
</#html:foreach>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* @param bodyClass body标签的class内容
|
||||
*/
|
||||
%>
|
||||
<!DOCTYPE html><html><head>
|
||||
<% print('<'+'!DOC'+'TYPE html'+'>'); %><html><head>
|
||||
<% include('../include/head.html', {title: text(title!)}){} %>
|
||||
</head><body class="${bodyClass!}">
|
||||
<div class="container">
|
||||
<% include('../include/header.html'){} %>
|
||||
${layoutContent}
|
||||
<% include('../include/footer.html'){} %>
|
||||
<% include('../include/header.html'){}
|
||||
%>${layoutContent}<%
|
||||
include('../include/footer.html'){} %>
|
||||
</div>
|
||||
@@ -19,13 +19,12 @@
|
||||
</#html:foreach>
|
||||
</ul>
|
||||
<div class="pagination">${@page.toHtml()}</div>
|
||||
<script type="text/javascript">
|
||||
function page(n,s){
|
||||
location="${category.url}?pageNo="+n+"&pageSize="+s;
|
||||
}
|
||||
<script>
|
||||
function page(n, s){
|
||||
location = "${category.url}?pageNo=" + n + "&pageSize=" + s;
|
||||
}
|
||||
</script>
|
||||
</#html:if>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<ul class="article-list">
|
||||
<#html:foreach items="${articleList(site.siteCode, category.categoryCode, 5)}" var="article,status">
|
||||
<li>${status.index}. <span class="pull-right">${article.updateDate,'yyyy-MM-dd'}</span>
|
||||
<a href="${article.url}" style="color:${article.color}">${abbr(article.title,28)}</a> </li>
|
||||
<a href="${article.url}" style="color:${article.color}">${abbr(article.title,28)}</a></li>
|
||||
</#html:foreach>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -38,4 +38,3 @@
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
|
||||
@@ -1,9 +1,27 @@
|
||||
<% layout('layouts/default.html', {title:'文章查看',libs: []}){ %>
|
||||
<% include('include/banner.html'){} %>
|
||||
<div class="row main article-view">
|
||||
<h3 class="article-title">${article.title}</h3>
|
||||
<blockquote class="article-desc">摘要:${article.description}</blockquote>
|
||||
<div class="article-content uparse">${article.articleData.content}</div>
|
||||
<div class="article-info">发布者:${article.createBy} 点击数:${article.hits} 发布时间:${article.createDate,"yyyy-MM-dd HH:mm"} 更新时间:${article.updateDate,"yyyy-MM-dd HH:mm"}</div>
|
||||
<h3 class="article-title">
|
||||
${article.title}
|
||||
</h3>
|
||||
<blockquote class="article-desc">
|
||||
摘要:${article.description}
|
||||
</blockquote>
|
||||
<div class="article-content uparse">
|
||||
${article.articleData.content}
|
||||
</div>
|
||||
<div class="article-info">
|
||||
发布者:${article.createBy}
|
||||
点击数:<span id="articleHits">~</span>
|
||||
发布时间:${article.createDate,"yyyy-MM-dd HH:mm"}
|
||||
更新时间:${article.updateDate,"yyyy-MM-dd HH:mm"}
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>
|
||||
$(function (){
|
||||
$.get('${ctx}/article-hits-${article.id}', function(data){
|
||||
$('#articleHits').html(data);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user