コード例 #1
0
ファイル: Bet.php プロジェクト: mdominoni/binarybtc
 public static function checkExpired()
 {
     $expired = Bet::available()->where('expires_at', '<=', date('Y-m-d H:i:s'))->whereNull('accepted_by_user_id')->lists('id');
     if (count($expired) > 0) {
         Bet::whereIn('id', $expired)->update(array('expired' => 1));
     }
     $finished = Bet::where('expires_at', '<=', date('Y-m-d H:i:s'))->whereNotNull('accepted_by_user_id')->where('winner_paid', 0)->get();
     foreach ($finished as $bet) {
         $bet->handleWinner();
     }
 }
コード例 #2
0
ファイル: routes.php プロジェクト: mdominoni/binarybtc
    if ($request->getMethod() === 'POST') {
        Route::callRouteFilter('custom_csrf', array(), '', $request);
    }
});
$btc_price = Bitcoin::toUSD();
View::share('btc_price', $btc_price);
$updated_at = strtotime(DB::table('price_hist')->orderBy('id', 'desc')->pluck('created_at'));
View::share('updated_at', $updated_at);
Bet::checkExpired();
Route::get('logout', function () {
    Auth::logout();
    return Redirect::to('/');
});
Route::get('/', function () {
    $prices = DB::table('price_hist')->get();
    $bets = Bet::available()->paginate(4);
    $server_time = date('H:i:s');
    return View::make('hello', compact('server_time', 'bets', 'prices'));
});
Route::post('/contact/submit', function () {
    $data = array('from' => Input::get('email'), 'body' => Input::get('message'));
    Mail::queue('emails.contact', $data, function ($message) {
        $message->to('*****@*****.**', 'Connor Smith')->subject('BinaryBTC Contact Form');
    });
    return array();
});
Route::get('/faq', function () {
    return View::make('faq');
});
Route::get('/latest_price', function () {
    if (!Request::ajax()) {