mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-24 19:59:31 +08:00
update
This commit is contained in:
@@ -48,6 +48,7 @@ public class Course implements Serializable {
|
||||
/**
|
||||
* 1:必修,0:选修
|
||||
*/
|
||||
@JsonProperty("is_required")
|
||||
private Integer isRequired;
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@Mapper
|
||||
public interface UserLearnDurationStatsMapper extends BaseMapper<UserLearnDurationStats> {
|
||||
|
||||
Integer getUserDateDuration(Integer userId, String createdDate);
|
||||
|
||||
Integer getUserDuration(Integer userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,12 @@ public class UserLearnDurationStatsServiceImpl extends ServiceImpl<UserLearnDura
|
||||
@Override
|
||||
public Integer todayUserDuration(Integer userId) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return getBaseMapper().getUserDateDuration(userId, simpleDateFormat.format(new Date()));
|
||||
String today = simpleDateFormat.format(new Date());
|
||||
UserLearnDurationStats stats = getOne(query().getWrapper().eq("user_id", userId).eq("created_date", today));
|
||||
if (stats == null) {
|
||||
return 0;
|
||||
}
|
||||
return stats.getDuration();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user