Skip to content
Merged

test #60

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
@Repository
public interface OptionFundingRepository extends JpaRepository<OptionFundingEntity, Long> {

@Query("select sum(f.count * f.option.price - coalesce(f.coupon.price, 0)) " +
"from OptionEntity o left join o.fundings f " +
"where o.project.id = :projectId " +
"group by f")
@Query("select sum(of.count * of.option.price - coalesce(of.coupon.price, 0)) " +
"from OptionFundingEntity of " +
"where of.option.project.id = :projectId ")
Long getTotalPriceByProject(@Param("projectId") Long projectId);

@Query("select sum(of.count) " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static ResponseProjectDetailDto of(
dto.sum = fundingPrice;
dto.completionRate = FundingUtil.getCompletionRate(dto.sum, dto.goal);
dto.likeCount = likeCount!=null?likeCount.intValue():0;
dto.isAuthor = entity.getUser().getId().equals(userId);
dto.isAuthor = userId != null && entity.getUser().getId().equals(userId);
dto.status = entity.getProjectStatus().name();
dto.startAt = entity.getStartAt();
dto.expiredAt = entity.getExpiredAt();
Expand Down
Loading