..
This commit is contained in:
@@ -18,7 +18,6 @@ import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -187,7 +186,24 @@ public class FlowTodoCenterController {
|
||||
dao.execute(doneSql);
|
||||
int doneCount = doneSql.getInt();
|
||||
|
||||
return Result.success(Map.of("startedCount", startedCount, "todoCount", todoCount, "doneCount", doneCount));
|
||||
// 查询未读消息
|
||||
Sql msgSql = Sqls.create("""
|
||||
SELECT
|
||||
count(DISTINCT r.messageId)
|
||||
FROM
|
||||
global_message_receiver r
|
||||
LEFT JOIN global_message m ON m.id = r.messageId
|
||||
WHERE
|
||||
r.receiverId = @userId
|
||||
AND r.isRead = 0
|
||||
AND m.`status` = 2
|
||||
""");
|
||||
msgSql.setParam("userId", SecurityUtil.getUserId());
|
||||
msgSql.setCallback(Sqls.callback.integer());
|
||||
dao.execute(msgSql);
|
||||
int msgCount = msgSql.getInt();
|
||||
|
||||
return Result.success(Map.of("startedCount", startedCount, "todoCount", todoCount, "doneCount", doneCount, "notifications", msgCount));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user