Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egg-mysql的筛选条件如何or #1035

Closed
xjchenhao opened this issue Jun 12, 2017 · 2 comments
Closed

egg-mysql的筛选条件如何or #1035

xjchenhao opened this issue Jun 12, 2017 · 2 comments

Comments

@xjchenhao
Copy link

开发团队你们好,

我想问下egg-mysql

const results = yield app.mysql.select('posts',{
  where: { status: 'draft',name: 'abc' },
  orders: [['created_at','desc'], ['id','desc']],
  limit: 10,
  offset: 0
});

这样的语句,where里的条件是AND的关系,如何筛选OR的关系呢?

@fengmk2
Copy link
Member

fengmk2 commented Jun 12, 2017

https://github.com/ali-sdk/ali-rds/blob/master/lib/operator.js#L184 目前只有 AND。

可以参与 ali-sdk/ali-rds#24 的讨论,看看如何增加 OR 的功能。

@xjchenhao
Copy link
Author

xjchenhao commented Jun 12, 2017

好的吧,我查了两次用concat拼接了😅 谢谢🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants