Skip to content

Commit

Permalink
fix the unclaimed redpacket
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 18, 2023
1 parent 7514ede commit fafd898
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ BaseResponse getRedPacketAll(@RequestParam String address,
BaseResponse getRedPacketByAddress(@RequestParam String address, @RequestParam(required = false) Integer status) {
List<RedPacket> result;
if(status == 0) {
result = redPacketRepository.findByUnclaimedPacket("%" + address + "%");
result = redPacketRepository.findByUnclaimedPacket("%" + address + "%", 0);
} else {
result = redPacketRepository.findByClaimedPacket("%" + address + "%");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public interface RedPacketRepository extends JpaRepository<RedPacket, String>,



@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 ", nativeQuery = true)
List<RedPacket> findByUnclaimedPacket(@Param("address") String address);
@Query(value = "select * from red_packet where address_list like ?1 and claimed_address not like ?1 and status = ?2 ", nativeQuery = true)
List<RedPacket> findByUnclaimedPacket(@Param("address") String address, @Param("status") Integer status);


RedPacket findByIdAndStatus(@Param("id") String id, @Param("status") Integer status);
Expand Down

0 comments on commit fafd898

Please sign in to comment.