From 6c11211fbae5c9a00bd5cfdb84dd4210e73220ab Mon Sep 17 00:00:00 2001 From: changpengfei Date: Sun, 26 Sep 2021 09:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=96=87=E7=AB=A0=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lyms/talkonlineweb/controller/ArticleController.java | 2 +- .../src/main/java/com/lyms/talkonlineweb/domain/LymsPushedart.java | 6 ++++++ .../main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java index fa3fd97..8514943 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java @@ -223,7 +223,7 @@ public class ArticleController { BaseResponse baseResponse=new BaseResponse(); try { UpdateWrapper updateWrapper = new UpdateWrapper<>(); - pushedart.setCreatedtime(new Date()); + pushedart.setReadtime(new Date()); updateWrapper.eq("pid",pushedart.getPid()).eq("aid", pushedart.getAid()); boolean f=lymsPushedartService.update(pushedart,updateWrapper); baseResponse.setErrorcode(f==true?0:1); diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushedart.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushedart.java index 12d07ff..27132de 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushedart.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPushedart.java @@ -45,6 +45,12 @@ public class LymsPushedart implements Serializable { @TableField(value = "createdtime") private Date createdtime; + /** + * 阅读时间 + */ + @TableField(value = "readtime") + private Date readtime; + @TableField(exist = false) private static final long serialVersionUID = 1L; diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java index 653223c..3d3d405 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java @@ -23,7 +23,7 @@ public interface LymsArticleMapper extends BaseMapper { @Select("SELECT COUNT(1) cnt FROM lyms_pushedart WHERE DATE(createdtime)=DATE(NOW())") Map todayPush(); // 今日已读 - @Select("SELECT COUNT(1) cnt FROM lyms_pushedart WHERE DATE(createdtime)=DATE(NOW()) AND isread=1") + @Select("SELECT COUNT(1) cnt FROM lyms_pushedart WHERE DATE(readtime)=DATE(NOW()) AND isread=1") Map todayRead(); @Select("SELECT COUNT(1) cnt FROM lyms_pushedart") -- 1.8.3.1