如何解决这个需求?:
我有用户$phone_numbers
=> 200000
$api_sending_numbers
(可以每小时向电话号码发送36000条短信)
如何划分$phone_numbers
并分配$sending_number
?
我的尝试是使用chunk()
$phone_numbers = PhoneNumber::get();
foreach ($phone_numbers->chunk(5) as $chunk_phone_numbers) {
foreach ($chunk_phone_numbers as $user) {
echo $user->phone_number;
}
};