本文整理汇总了PHP中Check::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::where方法的具体用法?PHP Check::where怎么用?PHP Check::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Check
的用法示例。
在下文中一共展示了Check::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$checks = Check::where('paused', '=', 0)->get();
foreach ($checks as $check) {
$hasChecked = CheckResult::where('check_id', '=', $check->id)->where('created_at', '>', date('Y-m-d H:i:s', time() - $check->interval * 60))->count();
if ($hasChecked == 0) {
Queue::push('CheckWebsite', $check->id);
}
}
}
示例2: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($lang, $user_id, $check_id)
{
if (Check::where('check_id', '=', $check_id)->count() == 1) {
$check = Check::where('check_id', '=', $check_id)->first();
if ($check->delete_check()) {
Session::flash('message', trans('kuu-validation.check_was_deleted'));
//$path = (Input::get('page', 1) > 1) ? '?page='.Input::get('page') : '';
//return Redirect::to('/admin/check/'.$user_id.$path);
return Redirect::route('admin.check.user', array('lang' => App::getLocale(), 'user_id' => $user_id, 'page' => Input::get('page')));
} else {
Session::flash('error_messages', trans('kuu-validation.check_was_not_deleted'));
}
} else {
Session::flash('error_message', trans('kuu-validation.check_was_not_found'));
return Redirect::route('admin.check.user', array('lang' => App::getLocale(), 'user_id' => $user_id));
}
}
示例3: get_user_check
static function get_user_check($user_id = 0)
{
if (!$user_id) {
$user_id = Sentry::getUser()->id;
}
return Check::where('user_id', '=', $user_id);
}