|
@@ -51,7 +51,8 @@ export class CourseService extends BaseService<modelType> {
|
|
|
// }
|
|
|
// 首页查询
|
|
|
async list(filter) {
|
|
|
- const { skip = 0, limit = 0, ...info } = filter;
|
|
|
+ const { skip = 0, limit = 0, title, ...info } = filter;
|
|
|
+ if (title) info.title = { $regex: title };
|
|
|
const data: any = await this.model.find(info).skip(skip).limit(limit).sort({ number: -1 }).lean();
|
|
|
for (const val of data) {
|
|
|
val.videoTotal = await this.vModel.count({ course: get(val, '_id') });
|