无法进行查询:select() 和 with()
Can’t make query: select() and with()
这是我的查询
await Order
.query()
.with('order_status')
.select('delivery_date')
.fetch()
结果将是:
[{
delivery_date: "2020-08-29"
order_status: null
}]
如您所见,order_status 为空,但是当我删除 .select
时,order_status 不为空
放弃使用 .with
,刚刚使用 .leftJoin
得到了我需要做的事情
这是我的查询
await Order
.query()
.with('order_status')
.select('delivery_date')
.fetch()
结果将是:
[{
delivery_date: "2020-08-29"
order_status: null
}]
如您所见,order_status 为空,但是当我删除 .select
时,order_status 不为空
放弃使用 .with
,刚刚使用 .leftJoin
得到了我需要做的事情