本文整理匯總了PHP中PhoneNumber::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhoneNumber::where方法的具體用法?PHP PhoneNumber::where怎麽用?PHP PhoneNumber::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhoneNumber
的用法示例。
在下文中一共展示了PhoneNumber::where方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generate_extension
private function generate_extension()
{
if (Request::segment(1) == "register") {
$domain_id = Cookie::get('domain_hash');
} else {
$domain_id = Request::segment(2) == "manage" ? Request::segment(3) : Auth::user()->domain_id;
}
$extensions = explode(",", str_replace(" ", "", Config::get('settings.reserved_extension')));
$users = User::where('domain_id', $domain_id)->get();
foreach ($users as $user) {
foreach (PhoneNumber::where('user_id', $user['id'])->get() as $phone_number) {
$extensions[] = $phone_number['extension'];
}
}
$rand_ext = rand(100000, 999999);
if (in_array($rand_ext, $extensions) && Cookie::get('rndext') == $rand_ext) {
$this->generate_extension();
} else {
return $rand_ext;
}
}