Commit fab2878c authored by 任国军's avatar 任国军

add cat_title

parent caa97bda
Pipeline #19227 passed with stage
in 11 seconds
...@@ -739,6 +739,13 @@ class InstitutionSubService extends Service { ...@@ -739,6 +739,13 @@ class InstitutionSubService extends Service {
// 用户是否点赞 // 用户是否点赞
const userLike = await ctx.classModel.V4.CourseLike.findOne({ where: { user_uuid: ctx.userUuid, type: 1, type_id: id, is_deleted: 0 } }); const userLike = await ctx.classModel.V4.CourseLike.findOne({ where: { user_uuid: ctx.userUuid, type: 1, type_id: id, is_deleted: 0 } });
// 获取分类
const cats = await ctx.classModel.V4.CourseCat.findAll({ where: { status: 'online', is_deleted: 0 } });
const catMap = new Map();
for (const v of cats) {
catMap.set(v.id, v);
}
// 获取关联列表 // 获取关联列表
let relations = []; let relations = [];
if (!ctx.isEmpty(article.relations)) { if (!ctx.isEmpty(article.relations)) {
...@@ -749,6 +756,7 @@ class InstitutionSubService extends Service { ...@@ -749,6 +756,7 @@ class InstitutionSubService extends Service {
id: article.id, id: article.id,
type: article.type, type: article.type,
cat_id: article.cat_id, cat_id: article.cat_id,
cat_title: catMap.has(v.cat_id) ? catMap.get(v.cat_id).name : '',
title: article.title, title: article.title,
description: article.description, description: article.description,
content: article.content, content: article.content,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment