本文整理匯總了PHP中Test::query方法的典型用法代碼示例。如果您正苦於以下問題:PHP Test::query方法的具體用法?PHP Test::query怎麽用?PHP Test::query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Test
的用法示例。
在下文中一共展示了Test::query方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
Log::debug('aaa');
//Test::get();
Test::query()->select('*')->get();
return View::make('pages.test.index');
}
示例2: count
<?php
include '../lib/common.inc.php';
$title = "Администрирование re:tester";
$tests = Test::query("SELECT id, name, (SELECT count(*) FROM questions where test_id=tests.id) AS question_count FROM tests ORDER BY name");
render('list.haml', array('tests' => $tests, 'tab' => 'all-tests', 'active_test_id' => $_GET['test_id']));
示例3: loginkit_require
<?php
include '../lib/common.inc.php';
loginkit_require('logged-in');
$partner = loginkit_current_user();
$tests = Test::query("SELECT id, name FROM tests ORDER BY name");
$host = $_SERVER['HTTP_HOST'];
foreach ($tests as &$test) {
$test->url = "http://{$host}/tests/{$test->id}/P{$partner->id}";
}
unset($test);
$title = "Ваши ссылки";
render('banners.haml', array('partner' => $partner, 'tests' => $tests, 'tab' => 'banners'));