💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[TOC] * [ ] 查询包含马的学生 ~~~ // 查询姓名包含马的学生 const { field = '' } = ctx.query const fields = field.split(';').filter(f => f) Student.findAll({ attributes: fields.length === 0 ? '' : fields, where: { name: { [Op.like]:'%马%' } } }) `student`.`name` LIKE '%马%' ~~~ ***** * [ ] 查询姓名**第二个字**为中的学生 ~~~ const { field = '' } = ctx.query const fields = field.split(';').filter(f => f) // 查询名字第二字包含中的学生 const ret = await Student.findAll({ attributes: fields.length === 0 ? '' : fields, where: { name: { [Op.like]:'_中%' } } }) `student`.`name` LIKE '_中%' ~~~ ***** * [ ] 查询姓名三个字的学生 ~~~ const { field = '' } = ctx.query const fields = field.split(';').filter(f => f) // 查询姓名为3个字符的学生 const ret = await Student.findAll({ attributes: fields.length === 0 ? '' : fields, where: { name: { [Op.like]:'___' } } }) `student`.`name` LIKE '___' ~~~