Fix(Store): Fix incorrect item count

Fixed incorrect item count when specifying platform
This commit is contained in:
2024-08-20 16:15:47 +08:00
parent 78c7b47d57
commit 3a631aa95c
3 changed files with 9 additions and 2 deletions

View File

@@ -27,7 +27,11 @@ interface StoreMapper : BaseMapper<Tool> {
* @since 1.0.0 * @since 1.0.0
* @see IPage * @see IPage
*/ */
fun selectAuthorToolIdPage(page: IPage<Long>, @Param("searchValue") searchValue: String?): IPage<String> fun selectAuthorToolIdPage(
page: IPage<Long>,
@Param("searchValue") searchValue: String?,
@Param("platform") platform: Platform? = null
): IPage<String>
/** /**
* Select author and tool ID by username in page * Select author and tool ID by username in page

View File

@@ -40,7 +40,7 @@ class StoreServiceImpl(
toolIdsPage.setOptimizeCountSql(false) toolIdsPage.setOptimizeCountSql(false)
val toolIdsIPage = val toolIdsIPage =
baseMapper.selectAuthorToolIdPage(toolIdsPage, toolStoreGetParam.searchValue) baseMapper.selectAuthorToolIdPage(toolIdsPage, toolStoreGetParam.searchValue, toolStoreGetParam.platform)
val toolPage = Page<Tool>(toolIdsIPage.current, toolIdsIPage.size, toolIdsIPage.total) val toolPage = Page<Tool>(toolIdsIPage.current, toolIdsIPage.size, toolIdsIPage.total)
if (toolIdsIPage.total > 0) { if (toolIdsIPage.total > 0) {
toolPage.setRecords(baseMapper.selectListByAuthorToolIds(toolIdsIPage.records, WebUtil.getLoginUserId(), toolStoreGetParam.platform)) toolPage.setRecords(baseMapper.selectListByAuthorToolIds(toolIdsIPage.records, WebUtil.getLoginUserId(), toolStoreGetParam.platform))

View File

@@ -20,6 +20,9 @@
or tk.keyword like concat('%', #{searchValue}, '%') or tk.keyword like concat('%', #{searchValue}, '%')
) )
</if> </if>
<if test="platform != null">
and temp1.platform = #{platform}
</if>
</where> </where>
<choose> <choose>
<when test="searchValue != null"> <when test="searchValue != null">