Skip to content

Commit

Permalink
fix #360: search reservation/ticket must be case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Oct 31, 2017
1 parent f1a4184 commit 947c523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/alfio/repository/TicketRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public interface TicketRepository {


String FIND_ALL_MODIFIED_TICKETS_WITH_RESERVATION_AND_TRANSACTION = "select * from ticket_and_reservation_and_tx where t_status in ('PENDING', 'ACQUIRED', 'TO_BE_PAID', 'CANCELLED', 'CHECKED_IN') and t_category_id = :categoryId and t_event_id = :eventId and " +
" (:search is null or (t_uuid like :search or t_full_name like :search or t_first_name like :search or t_last_name like :search or t_email_address like :search or " +
" tr_full_name like :search or tr_first_name like :search or tr_last_name like :search or tr_email_address like :search)) " +
" (:search is null or (lower(t_uuid) like lower(:search) or lower(t_full_name) like lower(:search) or lower(t_first_name) like lower(:search) or lower(t_last_name) like lower(:search) or lower(t_email_address) like lower(:search) or " +
" lower(tr_full_name) like lower(:search) or lower(tr_first_name) like lower(:search) or lower(tr_last_name) like lower(:search) or lower(tr_email_address) like lower(:search))) " +
" order by tr_confirmation_ts asc, tr_id, t_uuid";

@Query("select * from (" + FIND_ALL_MODIFIED_TICKETS_WITH_RESERVATION_AND_TRANSACTION + " limit :pageSize offset :page) as d_tbl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int postponePayment(@Bind("reservationId") String reservationId, @Bind("validity


String FIND_RESERVATIONS_IN_EVENT = " select * from tickets_reservation where event_id_fk = :eventId and status in (:status) " +
" and (:search is null or (full_name like :search or first_name like :search or last_name like :search or email_address like :search or billing_address like :search)) " +
" and (:search is null or (lower(full_name) like lower(:search) or lower(first_name) like lower(:search) or lower(last_name) like lower(:search) or lower(email_address) like lower(:search) or lower(billing_address) like lower(:search))) " +
" order by confirmation_ts desc, validity desc ";

@Query("select * from (" + FIND_RESERVATIONS_IN_EVENT +"limit :pageSize offset :offset) as r_tbl")
Expand Down

0 comments on commit 947c523

Please sign in to comment.