我需要相当于这个SQL查询select * from employees where first_name like '%fish%' or last_name like '%fish%'的动态查询。
我尝试了下面的代码,但不起作用。
const employees = EmsModel.query('pk')
.eq('emp_prof')
.and()
.where('first_name')
.contains(params.name)
.or()
.where('last_name')
.contains(params.name)
.exec();有人能指引我吗。
发布于 2020-10-30 12:19:43
这对我有用!
const employees = EmsModel.query('pk') .eq('emp_prof') .and() .parenthesis(new .parenthesis .exec();
)
https://stackoverflow.com/questions/64607473
复制相似问题