本文整理汇总了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'));