后台:跑马灯

This commit is contained in:
luying
2021-07-07 16:43:06 +08:00
parent a1aabfdd42
commit f45dd06621
6 changed files with 80 additions and 35 deletions

View File

@@ -29,6 +29,9 @@ export default class Marquee extends BaseModel {
@prop({ required: true })
content: string; // 广播内容
@prop({ required: true })
isRunning: boolean; // 当前正在发布
/**
* 创建跑马灯
* @param params 参数
@@ -75,10 +78,7 @@ export default class Marquee extends BaseModel {
private static getSearchObj(form: { type?: number, current?: boolean, content?: string }) {
let searchObj = {};
if(form['type']) searchObj['type'] = form.type;
if(form['current']) {
searchObj['startTime'] = { $lte: new Date };
searchObj['endTime'] = { $gte: new Date };
}
if(form['current']) searchObj['isRunning'] = form.current
if(form['content']) searchObj['content'] = { $regex: new RegExp(form.content.toString(), 'i') };
return searchObj
}