当前位置: 首页>>代码示例>>PHP>>正文


PHP Group::wherein方法代码示例

本文整理汇总了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);
 }
开发者ID:bishopm,项目名称:circuit,代码行数:30,代码来源:AppComposer.php


注:本文中的app\models\Group::wherein方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。