fix: filter daily reports by date

This commit is contained in:
richjohnrambo
2026-09-28 14:34:08 +08:00
parent 8773991015
commit 75f811bb9f
2 changed files with 15 additions and 2 deletions
+5 -1
View File
@@ -827,10 +827,14 @@ func (s *Store) DeleteMeetingNoteFile(ctx context.Context, userID int64, meeting
return s.meetingNoteFile(ctx, meetingID, noteFileID)
}
func (s *Store) DailyReports(ctx context.Context, userID int64, cursor string, limit int) ([]DailyReport, string, error) {
func (s *Store) DailyReports(ctx context.Context, userID int64, reportDate, cursor string, limit int) ([]DailyReport, string, error) {
var items []DailyReport
query := `SELECT report_id,author_id,report_date,content,attachments,status,read_state,version,submitted_at,created_at,updated_at FROM im_daily_reports WHERE tenant_id=? AND author_id=?`
args := []any{s.tenant(), userID}
if reportDate != "" {
query += ` AND report_date=?`
args = append(args, reportDate)
}
if cursor != "" {
query += ` AND report_id>?`
args = append(args, cursor)