修改api
This commit is contained in:
@@ -7,11 +7,10 @@ async function getHomeCategories(ctx) {
|
||||
hc.sort_order,
|
||||
c.id as category_id,
|
||||
c.name as category_name,
|
||||
c.icon as category_icon,
|
||||
c.image as category_image
|
||||
c.icon as category_icon
|
||||
FROM home_categories hc
|
||||
LEFT JOIN categories c ON hc.category_id = c.id
|
||||
WHERE hc.is_enabled = 1 AND c.status = 1
|
||||
WHERE hc.is_enabled = 1 AND c.is_show = 1
|
||||
ORDER BY hc.sort_order ASC
|
||||
`
|
||||
|
||||
@@ -21,7 +20,6 @@ async function getHomeCategories(ctx) {
|
||||
id: item.category_id,
|
||||
name: item.category_name,
|
||||
icon: item.category_icon,
|
||||
image: item.category_image,
|
||||
sortOrder: item.sort_order
|
||||
}))
|
||||
|
||||
@@ -60,7 +58,7 @@ async function updateHomeCategories(ctx) {
|
||||
}
|
||||
|
||||
async function getAllCategoriesForConfig(ctx) {
|
||||
const categories = await query('SELECT id, name, icon, image FROM categories WHERE status = 1 ORDER BY sort_order ASC')
|
||||
const categories = await query('SELECT id, name, icon, image FROM categories WHERE is_show = 1 ORDER BY sort_order ASC')
|
||||
const homeCategories = await query('SELECT category_id, sort_order, is_enabled FROM home_categories')
|
||||
|
||||
const homeMap = {}
|
||||
|
||||
Reference in New Issue
Block a user