课件列表报错修复

This commit is contained in:
wsw 2024-06-03 09:55:29 +08:00
parent e13ff1ae25
commit 6776fecfe9
2 changed files with 4 additions and 9 deletions

View File

@ -96,9 +96,6 @@
<when test="sortField == 'created_at'">
ORDER BY `courses`.`created_at` ASC
</when>
<when test="sortField == 'sort_at'">
ORDER BY `courses`.`sort_at` ASC
</when>
<otherwise>
ORDER BY `courses`.`id` ASC
</otherwise>
@ -115,9 +112,6 @@
<when test="sortField == 'created_at'">
ORDER BY `courses`.`created_at` DESC
</when>
<when test="sortField == 'sort_at'">
ORDER BY `courses`.`sort_at` DESC
</when>
<otherwise>
ORDER BY `courses`.`id` DESC
</otherwise>

View File

@ -146,9 +146,9 @@
SELECT DISTINCT ( `resources`.`type` )
FROM `resources`
<choose>
<when test="categoryIds != null and categoryIds != ''">
<when test="categoryIds != null and !categoryIds.isEmpty()">
<choose>
<when test="categoryIds.indexOf('0') == 0">
<when test="categoryIds.get(0) == 0">
LEFT JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
WHERE `resources`.`is_hidden` = 0
AND `resource_category`.`cid` IS NULL
@ -156,7 +156,8 @@
<otherwise>
INNER JOIN `resource_category` ON `resource_category`.`rid` = `resources`.`id`
WHERE `resources`.`is_hidden` = 0
AND `resource_category`.`cid` IN (#{categoryIds})
AND `resource_category`.`cid` IN (<foreach collection="categoryIds" item="tmpId" separator=",">
#{tmpId}</foreach>)
</otherwise>
</choose>
</when>