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


PHP Track::where方法代码示例

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


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

示例1: trackfav

 /**
  * Mark a track as favourite
  */
 private function trackfav()
 {
     Base::requireLogged();
     $ret = array('active' => 0);
     if (!Validate::id($_GET['scid'])) {
         return $ret;
     }
     $scid = (int) $_GET['scid'];
     // Check the soundcloud track id
     $track = Track::where('scid', $scid)->select('id')->findOne();
     if (!$track) {
         return $ret;
     }
     $id = $track->id;
     // Add the like
     TrackFav::filter('add', $id, LOGGED);
     // Get current status
     $ret['active'] = TrackFav::filter('isActive', $id, LOGGED);
     // Show status
     return $ret;
 }
开发者ID:nytr0gen,项目名称:plur-music-explorer,代码行数:24,代码来源:request.php

示例2: function

            } else {
                return View::make('user.register')->with('error', 'The registration failed. Please try again.');
            }
        } else {
            return View::make('user.register')->with('error', 'Passwords do not match');
        }
    }
});
Route::get('register', function () {
    if (Auth::check()) {
        return Redirect::to('dashboard');
    }
    return View::make('user.register');
});
Route::get('tracks/(:any)', function ($key) {
    $track = Track::where('urlkey', '=', $key)->take(1)->get();
    if (count($track) > 0) {
        return View::make('tracks.view')->with('track', $track);
    }
    return Response::error('404');
});
Route::get('/', function () {
    $track = new Track(array('admin' => 1, 'status' => 1, 'title' => 'Little Dragon - Twice (LSB Bootleg)', 'track_artist' => 1, 'urlkey' => 'djdjd^#*BXCB@!*#@&(SHS', 'result_purchase_url' => 'http://www.little-dragon.se', 'result_download_url' => 'http://www.little-dragon.se', 'player_download_url' => 'http://www.little-dragon.se'));
    //$track->save();
    $user = new User(array('username' => 'TheHydroImpulse', 'email' => 'dnfagnan@gmail.com', 'password' => 'password', 'salt' => 'd483jddj', 'banned' => false, 'activated' => true));
    //$user->save();
    $tracks = Track::all();
    return View::make('tracks.index')->with('tracks', $tracks);
});
/*
|--------------------------------------------------------------------------
开发者ID:niceboy120,项目名称:Music-Platform,代码行数:31,代码来源:routes.php


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