ORM 预加载 与 UUID 字段查询 出问题
顾客表ID字段为uuid,使用with预加载出问题。
以下是查询代码
Reception::with('customer')->get()
下面是执行的sql
select * from `cy_reception` order by `receptioned` asc, `created_at` desc limit 10 offset 0
select * from `cy_customer` where `cy_customer`.`id` in (0, 30, 42, 5082, 5, 7630, 0, 0)
为什么这边的 where in
数据不是uuid
下面是查询结果
需要在 model 里面指定主键为 string 类型