本文整理汇总了PHP中app\models\Group::wherein方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::wherein方法的具体用法?PHP Group::wherein怎么用?PHP Group::wherein使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Group
的用法示例。
在下文中一共展示了Group::wherein方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compose
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$data['user'] = Auth::user();
$perms = Auth::user()->menushow()->get();
foreach ($perms as $perm) {
$ltdperms[] = $perm->society_id;
}
$data['groups'] = Group::wherein('society_id', $ltdperms)->where('contact', '=', $data['user']->individual_id)->orderBy('groupname')->get();
$data['recentedits'] = Individual::socindivrecent($ltdperms)->orderBy('individuals.updated_at', 'desc')->take(5)->get();
$data['recentadds'] = Individual::socindivrecent($ltdperms)->orderBy('individuals.created_at', 'desc')->take(5)->get();
$data['recentpastorals'] = Pastoral::with('household', 'individual')->has('household')->orderBy('diarydate', 'desc')->take(5)->get();
$thisyr = date("Y");
$mon = strval(date('m-d', strtotime("next Monday") - 604800));
$tue = strval(date('m-d', strtotime("next Monday") + 86400 - 604800));
$wed = strval(date('m-d', strtotime("next Monday") + 172800 - 604800));
$thu = strval(date('m-d', strtotime("next Monday") + 259200 - 604800));
$fri = strval(date('m-d', strtotime("next Monday") + 345600 - 604800));
$sat = strval(date('m-d', strtotime("next Monday") + 432000 - 604800));
$sun = strval(date('m-d', strtotime("next Monday") + 518400 - 604800));
$days = array($mon, $tue, $wed, $thu, $fri, $sat, $sun);
$data['birthdays'] = Individual::join('households', 'household_id', '=', 'households.id')->select('individuals.id', 'society_id', 'household_id', 'homephone', 'householdcell', 'cellphone', 'firstname', 'surname', DB::raw('substr(birthdate, 6, 5) as bd'))->wherein(DB::raw('substr(birthdate, 6, 5)'), $days)->orderBy(DB::raw('substr(birthdate, 6, 5)'))->get();
$data['anniversaries'] = Specialday::join('households', 'household_id', '=', 'households.id')->select('homephone', 'society_id', 'householdcell', 'addressee', 'household_id', 'anntype', 'details', DB::raw('substr(anniversarydate, 6, 5) as ad'))->wherein(DB::raw('substr(anniversarydate, 6, 5)'), $days)->orderBy(DB::raw('substr(anniversarydate, 6, 5)'))->get();
$view->with($data);
}