where(["is_send" => 0])->all(); foreach ($LwtPhoneMessageList as $LwtPhoneMessage) { /** @var LwtPhoneMessageList $LwtPhoneMessage */ foreach (PhoneMessage::$phoneList as $phone) { $resultList[] = PhoneMessage::sendNoticeMsg($phone, $LwtPhoneMessage->company_name, $LwtPhoneMessage->code); } $idList[] = $LwtPhoneMessage->id; } if ($idList != []) { LwtPhoneMessageList::updateAll(["is_send" => 1, "update_time" => time()], ["id" => $idList]); } var_dump($resultList); } }