杂判断问题,求大佬
thymeleaf吧
全部回复
仅看楼主
level 2
lovelee如初 楼主
<table>
<thead>
<tr>
<th>用户名</th>
<th>日期</th>
<th>签到时间</th>
</tr>
</thead>
<tbody>
<tr th:if="${signList!=null}" th:each="sign,sStat:${signList}">
<td th:text="${sign.getUserName()}"></td>
<td th:text="${#dates.format(sign.getSignDate(),'MM-dd')}"></td>
<!-- 这个判断怎么写
判断日期是否为今天

判断签到时间是否为空

显示签到按钮

显示签到时间

判断签到时间是否为空

显示'-'

显示签到时间
-->
</tr>
</tbody>
</table>
数据
签到情况列表
用户名 日期 签到时间
aaa 8-17 08:00
aaa 8-18 08:00
aaa 8-19 null
aaa 8-20 08:00
aaa 8-21 08:00
aaa 8-22 null
期望结果
用户名 日期 签到时间
aaa 8-17 08:00
aaa 8-18 08:00
aaa 8-19 -
aaa 8-20 08:00
aaa 8-21 08:00
aaa 8-22 签到按钮
2020年08月22日 12点08分 1
level 2
lovelee如初 楼主
[呵呵]写了四个判断解决了
1.日期是今天&&签到时间为空
2.日期是今天&&签到时间不为空
3.日期是不今天&&签到时间为空
4.日期不是今天&&签到时间不为空
2020年08月23日 04点08分 2
1