本文整理汇总了PHP中Vote::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Vote::get方法的具体用法?PHP Vote::get怎么用?PHP Vote::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vote
的用法示例。
在下文中一共展示了Vote::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//$votes = Response::json(Vote::all());
$err = '';
$votes = Vote::get();
return View::make('tasks.index2', compact('votes', 'err'));
}
示例2: array
// Route::get('t', 'CandidateController@create');
// Route::get('t2', 'CandidateController@store_a');
Route::get('excel', ['as' => 'import_cadidates', 'uses' => 'CandidateController@create']);
Route::get('excel_value', ['as' => 'import_cadidates_value', 'uses' => 'CandidateController@create']);
Route::get('store_a', ['as' => 'store_cadidates', 'uses' => 'CandidateController@store_a']);
//Route::get('/passsec/', ['as' => 'passsec', 'uses' => 'VoteController@passsec']);
Route::post('file_import', ['as' => 'file_import', 'uses' => 'CandidateController@file_move']);
Route::get('candidates_index', ['as' => 'cadidates', 'uses' => 'CandidateController@index']);
//Route::get('/', ['as' => 'home']);
Route::get('/{id}', array('as' => 'vote.edit', function ($id) {
// return our view and Vote information
return View::make('tasks.vote-edit')->with('vote', Vote::find($id));
}))->where('id', '[0-9]+');
Route::get('/manage', array('as' => 'manage', function () {
$time_now = Carbon::now();
$votes = Vote::get();
$ary[0] = $votes;
foreach ($ary[0] as $vote) {
// $candidate = Candidate::find($vote->id);
$candidate_c = Candidate::where('vote_id', '=', $vote->id)->first();
if ($candidate_c != null) {
$ary[1][$vote->id] = $candidate_c->vote_id;
} else {
$ary[1][$vote->id] = '沒有資料';
}
}
// return our view and Vote information
return View::make('tasks.vote-manage-index', compact('ary', 'time_now'));
}));
Route::get('/candidate_data_show/{id}', array('as' => 'candidate_data_show', function ($id) {
$candidates = Candidate::where('vote_id', '=', $id)->get();