Commit 5ba0fa9d authored by 任国军's avatar 任国军

fix limit bug

parent 8c14f14b
Pipeline #22731 passed with stage
in 3 seconds
......@@ -15,7 +15,7 @@ class InstitutionSubService extends Service {
const page_size = Number(input.page_size) || 10;
const offset = (page - 1) * page_size;
const attributes = [ 'id', 'institution_id', 'name', 'logo', 'age', 'price', 'price_type', 'mode', 'time', 'class_amount', 'multi_classes', 'cycle', 'description', 'sort' ];
const filter = { where: { status: 1, is_deleted: 0 }, order: [[ 'sort', 'asc' ], [ 'id', 'desc' ]], page_size, offset, attributes, raw: true };
const filter = { where: { status: 1, is_deleted: 0 }, order: [[ 'sort', 'asc' ], [ 'id', 'desc' ]], limit: page_size, offset, attributes, raw: true };
let filterIds = [];
let flag = false;
// 年龄筛选
......@@ -175,7 +175,7 @@ class InstitutionSubService extends Service {
// 用户收藏的课程
const userCollection = await ctx.classModel.V5.CourseUserCollection.findAndCountAll({ where: { user_uuid: ctx.userUuid, is_deleted: 0, type: 3 }, raw: true });
const collectedIds = R.pluck('type_id', userCollection.rows);
const filter = { where: { id: { $in: collectedIds }, status: 1, is_deleted: 0 }, page_size, offset, attributes, raw: true };
const filter = { where: { id: { $in: collectedIds }, status: 1, is_deleted: 0 }, limit: page_size, offset, attributes, raw: true };
const classList = await ctx.classModel.V5.CourseV5Class.findAll(filter);
for (const i in classList) {
classList[i].price_type = await this.getClassPriceType(classList[i].price_type);
......
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