How much of the data association model data downloaded by laravel exceeds the number of mysql placeholders?

1. Query the user list and initially change the associated order table, but there are too many users, which causes the mysql placeholder to pass and a mysql error is reported.

2, User::with ("order")-> get ()

error: General error: 1390 Prepared statement contains too many placeholders

select * from order where user_id in (xxx,xxx,.)
because the data associated with the order needs to be looped later.
foreach ($user as $v) {

$order_list = $v->order;
$temp_test = [];
if (count($order_list) > 0) {
    foreach ($order_list as $ov) {
        $temp_test[] = $ov->order_id;
    }
}
$data = [
    "user_id" => $v->user_id,
    "order_id" => implod(",", $temp_test)
];
echo $this->downExcel($data);

}

Feb.28,2021

use chunk .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b99b67-2f18f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b99b67-2f18f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?