本文整理汇总了PHP中Jobs::Limit方法的典型用法代码示例。如果您正苦于以下问题:PHP Jobs::Limit方法的具体用法?PHP Jobs::Limit怎么用?PHP Jobs::Limit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jobs
的用法示例。
在下文中一共展示了Jobs::Limit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$orderby = "start_time";
if (isset($_POST["sort-level1"])) {
$orderby = $_POST["sort-level1"];
}
//if ($orderby != "nprocs" && $orderby != "total_bytes") {
// $orderby = $orderby . "/(runtime + shared_time_by_cumul_io_only - shared_time_by_cumul_meta_only)";
//}
$mode1 = "desc";
if (isset($_POST["mode-level1"])) {
// echo "set to ". $_POST["mode-level1"];
$mode1 = $_POST["mode-level1"];
}
//$orderby = "notio" . "/(runtime + shared_time_by_cumul_io_only - shared_time_by_cumul_meta_only) asc";
//$orderby .= ", globalio";
$q = Jobs::OrderBy($q, $orderby, $mode1);
$q = Jobs::Limit($q, 5000);
if (isset($_POST["sort-level2"])) {
$sortlevel2 = $_POST["sort-level2"];
$mode2 = "desc";
if (isset($_POST["mode-level2"])) {
$mode1 = $_POST["mode-level2"];
}
$q = Jobs::addSortingLevel($q, $sortlevel2, $mode2);
}
if (isset($_POST["sort-level3"])) {
$sortlevel3 = $_POST["sort-level3"];
$mode3 = "desc";
if (isset($_POST["mode-level3"])) {
$mode1 = $_POST["mode-level3"];
}
$q = Jobs::addSortingLevel($q, $sortlevel3, $mode3);
示例2: actionFilter
public function actionFilter()
{
if (!YII_DEBUG && !Yii::app()->request->isAjaxRequest) {
throw new CHttpException('403', 'Forbidden access.');
}
$result = array();
$url = $_POST["url"];
$pos = strrpos($url, "?");
$chartId = substr($url, $pos + 3);
// echo $chartId;
$chart = getChartInfo($chartId);
$result["msg"] = "successful";
$result["chart"] = $chart;
$q = $chart["query"];
if (isset($_POST["start_date"]) && strlen($_POST["start_date"]) > 0) {
$q = Jobs::filter($q, "start_time", $_POST["start_date"], ">");
}
if (isset($_POST["end_date"]) && strlen($_POST["end_date"]) > 0) {
$q = Jobs::filter($q, "end_time", $_POST["end_date"], "<");
}
if (isset($_POST["application"]) && strlen($_POST["application"]) > 0) {
$q = Jobs::filter($q, "appname", $_POST["application"]);
}
if (isset($_POST["numapp"]) && strlen($_POST["numapp"]) > 0) {
$q = Jobs::Limit($q, $_POST["numapp"]);
}
if (!isset($q["order"])) {
$orderby = "start_time";
} else {
$orderby = $q["order"];
}
if (isset($_POST["sort_level1"]) && strlen($_POST["sort_level1"]) > 0) {
$orderby = $_POST["sort_level1"];
}
$mode1 = "desc";
if (isset($_POST["mode_level1"])) {
$mode1 = $_POST["mode_level1"];
}
$q = Jobs::OrderBy($q, $orderby, $mode1);
$q = Jobs::Limit($q, 15000);
if (isset($_POST["sort_level2"]) && strlen($_POST["sort_level2"]) > 0) {
$sortlevel2 = $_POST["sort_level2"];
$mode2 = "desc";
if (isset($_POST["mode_level2"])) {
$mode1 = $_POST["mode_level2"];
}
$q = Jobs::addSortingLevel($q, $sortlevel2, $mode2);
}
if (isset($_POST["sort_level3"]) && strlen($_POST["sort_level3"]) > 0) {
$sortlevel3 = $_POST["sort_level3"];
$mode3 = "desc";
if (isset($_POST["mode_level3"])) {
$mode1 = $_POST["mode_level3"];
}
$q = Jobs::addSortingLevel($q, $sortlevel3, $mode3);
}
if (isset($_POST["user"]) && strlen($_POST["user"]) > 0) {
$q = Jobs::filter($q, "uid", $_POST["user"]);
}
//var_dump($q) ;
$data = Jobs::execSQLQuery($q);
//print_r($data);
$preprocess = $chart["preprocess"];
$queryResult = $preprocess($chart, $data);
$result["queryresult"] = $queryResult;
$result["query"] = $q;
// $result = array_merge($result, $result2);
//echo $series_str;
// print_r($_GET);
// if (empty($_GET['data'])) {
// throw new CHttpException('404', 'Missing "data" GET parameter.');
// }
// $term = $_GET['term'];
// $filters = empty($_GET['exclude']) ? null : (int) $_GET['exclude']);
// echo json_encode(User::completeTerm($term, $exclude));
header('Content-Type: application/json; charset="UTF-8"');
echo json_encode($result);
Yii::app()->end();
}