多对一查询问题 [ 新手入门 ]
customer表
id|username
1 |张三
2 |李四
3 |王五
order表
id|user_id|order_id|order_state
1 |1 |1001 |0
2 |1 |1002 |1
3 |1 |1003 |1
4 |2 |1004 |1
5 |2 |1005 |0
order表中的user_id和customer表中的id关联
hasOne是多对一,那么如何查询出order_state为0的订单所对应的用户?
结果是:
id|username
1 |张三
2 |李四
共 0 条回复
没有找到数据。
mhtt
注册时间:2017-01-03
最后登录:2017-04-01
在线时长:4小时1分
最后登录:2017-04-01
在线时长:4小时1分
- 粉丝0
- 金钱15
- 威望0
- 积分55