|
@@ -3,7 +3,7 @@ import { InjectEntityModel } from '@midwayjs/typegoose';
|
|
|
import { ReturnModelType } from '@typegoose/typegoose';
|
|
|
import { BaseService, PageOptions, SearchBase } from 'free-midway-component';
|
|
|
import { Chat } from '../entity/chat.entity';
|
|
|
-import { cloneDeep } from 'lodash';
|
|
|
+import { cloneDeep, get, head } from 'lodash';
|
|
|
import { ChatMqService } from './chatMq.service';
|
|
|
import { Types } from 'mongoose';
|
|
|
import { JwtService } from '@midwayjs/jwt';
|
|
@@ -124,7 +124,6 @@ export class ChatService extends BaseService<modelType> {
|
|
|
if (skip && skip >= 0) pipes.push({ $skip: skip });
|
|
|
if (limit && limit > 0) pipes.push({ $limit: limit });
|
|
|
const result = await this.model.aggregate(pipes);
|
|
|
- // return { data: result, total: get(head(totalResult), 'total') };
|
|
|
- return { data: result, total: 0 };
|
|
|
+ return { data: result, total: get(head(totalResult), 'total') };
|
|
|
}
|
|
|
}
|