Commit 6c56e7c3 authored by 任国军's avatar 任国军

fix bug

parent 56f5f001
Pipeline #19446 passed with stage
in 57 seconds
......@@ -193,13 +193,13 @@ class OnlineService extends Service {
created_time: moment().format('YYYY-MM-DD HH:mm:ss'),
};
const check = await ctx.classModel.CourseUserCollection.findOne({ where: { user_uuid: userUuid, type: 5, type_id: id, is_deleted: 0 } });
const check = await ctx.classModel.V4.CourseUserCollection.findOne({ where: { user_uuid: userUuid, type: 5, type_id: id, is_deleted: 0 } });
if (!ctx.isEmpty(check)) {
ctx.failed('请勿重复收藏');
}
const ret = await ctx.classModel.CourseUserCollection.create(data);
return ret;
const ret = await ctx.classModel.V4.CourseUserCollection.create(data);
return { result: ret.id };
}
......@@ -212,7 +212,7 @@ class OnlineService extends Service {
const userUuid = ctx.userUuid;
const userCollection = await ctx.classModel.V4.CourseUserCollection.findAndCountAll({ where: { user_uuid: userUuid, is_deleted: 0, type: 5 }, raw: true, limit, offset });
let classIds = R.pluck('type_id', userCollection);
let classIds = R.pluck('type_id', userCollection.rows);
const filter = { where: { id: { $in: classIds }, status: 'online', is_deleted: 0 }, order: [[ 'institution_id', 'desc' ]], limit, offset, attributes: [ 'id', 'institution_id', 'name', 'price', 'type', 'age', 'mode', 'time', 'created_time' ] };
const classes = await ctx.classModel.V4.CourseOnlineClass.findAll(filter);
......
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