本文整理汇总了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;
}
}