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


PHP Student::select方法代码示例

本文整理汇总了PHP中app\models\Student::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::select方法的具体用法?PHP Student::select怎么用?PHP Student::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Student的用法示例。


在下文中一共展示了Student::select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getExportTeams

 /**
  * Export the teams and CE into a CSV file.
  *
  * @return string
  */
 public function getExportTeams()
 {
     $students = Student::select(['first_name', 'last_name', 'phone', 'email', 'team_id'])->orderBy('last_name')->where('ce', 1)->whereNotNull('team_id')->where('team_accepted', 1)->join('teams as t', 't.id', '=', 'students.team_id')->addSelect(\DB::raw('t.name as team_name'))->get();
     return Excel::create('Teams', function ($file) use($students) {
         $file->sheet('', function ($sheet) use($students) {
             $sheet->fromArray($students);
         });
     })->export('csv');
 }
开发者ID:ungdev,项目名称:integration-UTT,代码行数:14,代码来源:PagesController.php

示例2: list

 /**
  *
  * @return Response
  */
 public function list()
 {
     // Find students
     $students = Student::select([DB::raw('student_id AS id'), 'first_name', 'last_name', 'phone', DB::raw('1 AS student'), DB::raw('1 AS parent_authorization'), 'wei_payment', 'sandwich_payment', 'guarantee_payment', DB::raw('(ce AND team_accepted) AS ce'), 'volunteer', 'orga', 'wei_validated'])->where('wei', 1)->with('weiPayment')->with('sandwichPayment')->with('guaranteePayment');
     // Find newcomers
     $newcomer = Newcomer::select(['id', 'first_name', 'last_name', 'phone', DB::raw('0 AS student'), 'parent_authorization', 'wei_payment', 'sandwich_payment', 'guarantee_payment', DB::raw('0 AS ce'), DB::raw('0 AS volunteer'), DB::raw('0 AS orga'), DB::raw('1 AS wei_validated')])->where('wei', 1)->with('weiPayment')->with('sandwichPayment')->with('guaranteePayment');
     // Union between newcomers and students
     $users = $students->union($newcomer)->orderBy('last_name')->get();
     return View::make('dashboard.wei.list', ['users' => $users]);
 }
开发者ID:ungdev,项目名称:integration-UTT,代码行数:14,代码来源:WEIController.php

示例3: prematch

 public function prematch()
 {
     return View::make('dashboard.referrals.prematch', ['referralCountries' => Student::select('country')->where(['referral' => 1, 'referral_validated' => 1])->groupBy('country')->lists('country'), 'newcomerCountries' => Newcomer::select('country')->groupBy('country')->lists('country'), 'referralBranches' => Student::select('branch')->where(['referral' => 1, 'referral_validated' => 1])->groupBy('branch')->lists('branch'), 'newcomerBranches' => Newcomer::select('branch')->groupBy('branch')->lists('branch')]);
 }
开发者ID:ungdev,项目名称:integration-UTT,代码行数:4,代码来源:ReferralsController.php


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