注册

laravel 查询数据带wherein报错 General error: -6111 Fail to cast string

吖00 2024/01/05 884 0

【DM版本】:dm8
【操作系统】:liunx
【CPU】:
【问题描述】*:

$unique_arr = collect($multiple)->pluck('unique_code')->toArray();
Teacher::withTrashed()->where('school_id', $params['school_id'])->whereIn('unique_code', $unique_arr)->get( ['id', 'unique_code', 'name', 'phone'])->toArray();

通过把$unique_arr里的数据,分别加上'',就不会报错。
也修改兼容参数了 CASE_COMPATIBLE_MODE = 2了,还是不行。
有没有不改代码的情况下适配这种操作。

回答 0
暂无回答
扫一扫
联系客服