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


PHP Entry::confirmed方法代码示例

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


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

示例1: score

 /**
  * Recalculates the scores for the competition entries and (optionally) sends
  * a notification email to the contestants.
  */
 public function score()
 {
     $msg = "Updated the scores for the competition entries";
     $entries = Entry::confirmed()->get();
     foreach ($entries as $entry) {
         $entry->calculateScore();
     }
     if (Input::has('send_notifications')) {
         $send_notifications = Input::get('send_notifications');
         if ($send_notifications) {
             $entries->sortByDesc('score');
             $top_three = $entries->take(3);
             $contestants = $entries->lists('email');
             Mail::send('emails.score', array('entries' => $top_three), function ($message) use($contestants) {
                 $message->to($contestants)->subject('RWC 2015 Competition');
             });
             $msg = "Updated the scores for the competition entries and sent emails to the contestants.";
         }
     }
     return Redirect::route('admin.index')->withInfo($msg);
 }
开发者ID:ajwgibson,项目名称:rugby-world-cup-laravel,代码行数:25,代码来源:AdminController.php

示例2: index

 public function index()
 {
     $entries = Entry::confirmed()->orderBy('score', 'desc')->orderBy('first_name')->orderBy('last_name')->get();
     return View::make('home')->with('entries', $entries);
 }
开发者ID:ajwgibson,项目名称:rugby-world-cup-laravel,代码行数:5,代码来源:HomeController.php


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