后台:邮件查询
This commit is contained in:
@@ -4,10 +4,11 @@ import { GMMailModel } from '@db/GMMail';
|
||||
import { STATUS } from '@consts';
|
||||
import { GMMailRecordModel } from '@db/GMMailRecord';
|
||||
import { RewardInter } from '@pubUtils/interface';
|
||||
import { SearchMailParam } from '@domain/backEndField/search';
|
||||
|
||||
export default class Mail extends Service {
|
||||
|
||||
public async getGMMailList(page: number, pageSize: number, sortField: string, sortOrder: string, form: {}) {
|
||||
public async getGMMailList(page: number, pageSize: number, sortField: string, sortOrder: string, form: SearchMailParam) {
|
||||
const { ctx } = this;
|
||||
const list = await GMMailModel.findByCondition(page, pageSize, sortField, sortOrder, form);
|
||||
const total = await GMMailModel.countByCondition( form )
|
||||
@@ -16,12 +17,12 @@ export default class Mail extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
public async updateGMMail(_id: string, content: string, sendName: string, useTempTime: boolean, sendTime: number, endTime: number, continueHour: number, goods: RewardInter[]) {
|
||||
public async updateGMMail(_id: string, goods: RewardInter[]) {
|
||||
const { ctx } = this;
|
||||
if(_id == 'new') {
|
||||
await GMMailModel.addMail({ content, sendName, useTempTime, sendTime, endTime, continueHour, goods });
|
||||
await GMMailModel.addMail({ goods });
|
||||
} else {
|
||||
await GMMailModel.updateMailById(_id, { content, sendName, useTempTime, sendTime, endTime, continueHour, goods });
|
||||
await GMMailModel.updateMailById(_id, { goods });
|
||||
}
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user