Bladeren bron

新闻显示发布时间调整

anderx 3 jaren geleden
bovenliggende
commit
ff64bfd434

+ 11 - 1
src/main/java/com/goafanti/common/bo/PolicyEntity.java

@@ -17,7 +17,17 @@ String titleImg;
 String source;
 //String firstPictureUrl;
 String sourceUrl;
-public String getSourceUrl() {
+String releaseDate;
+
+	public String getReleaseDate() {
+		return releaseDate;
+	}
+
+	public void setReleaseDate(String releaseDate) {
+		this.releaseDate = releaseDate;
+	}
+
+	public String getSourceUrl() {
 	return sourceUrl;
 }
 public void setSourceUrl(String sourceUrl) {

+ 1 - 1
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -380,7 +380,7 @@ order by
 	create_time desc limit #{0}
 </select>
 <select id="getPolicyDetail" resultType="com.goafanti.common.bo.PolicyEntity">
-select p.id,p.title,p.title_img as titleImg,p.summary,
+select p.id,p.title,p.title_img as titleImg,p.summary,p.release_date as releaseDate,
 p.content,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime ,create_time as createTime,p.id,p.source,p.source_url as sourceUrl from policy p
 left join district_glossory dg1 on dg1.id=p.province
 left join district_glossory dg2 on dg2.id=p.city

+ 3 - 3
src/main/webapp/WEB-INF/views/portal/news/newsDetail.html

@@ -17,10 +17,10 @@
 			<div class="content_left" th:each="newsDetail:${newsDetail}">
 				<h3 th:text="${newsDetail.title}?${newsDetail.title}:''"></h3>
 				<div class="small_title">
-					<span>时间:<span th:text="${newsDetail.createTime}?${#dates.format(newsDetail.createTime,'yyyy-MM-dd')}:''"></span></span>
+					<span>时间:<span th:text="${newsDetail.createTime}?${#dates.format(newsDetail.releaseDate,'yyyy-MM-dd')}:''"></span></span>
 					<span>来源:<span th:text="${newsDetail.source}?${newsDetail.source}:行业新闻"></span></span>
 				</div>
-				<div th:each="img:${imgs}" class="content_img">					
+				<div th:each="img:${imgs}" class="content_img">
 					<img th:src="${avatarUploadHost+img}" alt="" />
 				</div>
 				<p th:utext="${newsDetail.content}?${newsDetail.content}:'暂无内容'">
@@ -71,4 +71,4 @@
 </body>
 
 
-</html>
+</html>