fix: filter daily reports by date
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user