想做一个筛选的功能,分成:全部、A、B、C、D、其他,现在其他不知道如何写?

发布于 5 年前作者 gchen1924 次浏览最后编辑 5 年前来自 ask

比如 数据库字段 test[A,B] 筛选类型分为全部、A、B、C、D、其他,通过给筛选用到的变量赋值

筛选有A的数据 let card=A, where({ test:card })

有B的数据 let card=B, where({ test:card })

有C的数据 let card=C, where({ test:card })

如果要筛选全部,和其他,该如何写,保证不改变语法,只通过赋值就可以实现?请教

1 回复
mqiao
mqiao1 楼3 年前

数据库记录结构是怎样的,test是数组?