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


PHP CRequest::makeSelectCount方法代码示例

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


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

示例1: CRequest

                $_query = $callback($ds, $_row);
                $ds->exec($_query);
                $counts["insert"] += $ds->affectedRows();
            }
        }
    }
    // Delete user logs entries
    $request = new CRequest();
    $request->addWhereClause("user_log_id", "BETWEEN {$min} AND {$max}");
    $request->addForceIndex("PRIMARY");
    $request->addWhere($where);
    $query = $request->makeDelete($log);
    $ds->exec($query);
    $counts["insert"] = $ds->affectedRows();
} else {
    $query = $request->makeSelectCount($log);
    $counts["insert"] = $ds->loadResult($query);
}
//</editor-fold>
$offset = $max + 1;
// Stop auto if end is reached
$log->loadMatchingObject("user_log_id DESC");
if ($log->_id < $offset) {
    $auto = 0;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("log", $log);
$smarty->assign("auto", $auto);
$smarty->assign("execute", $execute);
$smarty->assign("removers", $removers);
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:sanitize_userlogs.php

示例2: countMultipleList

 /**
  * Object count of a multiple list by an SQL request constructor using group-by statement
  *
  * @param array        $where  Array of where clauses
  * @param array|string $order  Order statement
  * @param array|string $group  Group by statement
  * @param array        $ljoin  Array of left join clauses
  * @param array        $fields Append fields to the SELECT
  * @param array|string $index  Force index
  *
  * @return self[]
  */
 function countMultipleList($where = null, $order = null, $group = null, $ljoin = null, $fields = array(), $index = null)
 {
     if (!$this->_ref_module) {
         return null;
     }
     $request = new CRequest();
     $request->addWhere($where);
     $request->addOrder($order);
     $request->addGroup($group);
     $request->addLJoin($ljoin);
     $request->addForceIndex($index);
     $ds = $this->_spec->ds;
     return $ds->loadList($request->makeSelectCount($this, $fields));
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:26,代码来源:CStoredObject.class.php

示例3: CRequest

}
$request = new CRequest();
$request->addTable($table);
$request->addSelect("*");
$request->setLimit("{$start},{$count}");
if ($orderby) {
    $request->addOrder($orderby);
}
if ($where_column) {
    $where = array($where_column => $ds->prepare("=?", $where_value));
    $request->addWhere($where);
}
$rows = $ds->loadList($request->makeSelect());
$request->setLimit(null);
$request->order = null;
$total = $ds->loadResult($request->makeSelectCount());
$counts = array(10, 50, 100, 200, 500, 1000, 5000);
$smarty = new CSmartyDP();
$smarty->assign("rows", $rows);
$smarty->assign("columns", $columns);
$smarty->assign("tooltip", $tooltip);
$smarty->assign("dsn", $dsn);
$smarty->assign("table", $table);
$smarty->assign("total", $total);
$smarty->assign("start", $start);
$smarty->assign("count", $count);
$smarty->assign("counts", $counts);
$smarty->assign("order_column", $order_column);
$smarty->assign("order_way", $order_way);
$smarty->assign("where_column", $where_column);
$smarty->assign("where_value", $where_value);
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:ajax_vw_table_data.php

示例4: array

/** @var CUser[] $users */
$users = array();
if ($group_similar && $group_similar !== 'no') {
    if ($group_similar === 'signature') {
        $groupby = "signature_hash";
    }
    if ($group_similar === 'similar') {
        $groupby = "text, stacktrace_id, param_GET_id, param_POST_id";
    }
    $request = new CRequest();
    $request->addWhere($where);
    $request->addOrder($order);
    $request->addGroup($groupby);
    $request->setLimit($limit);
    $fields = array("GROUP_CONCAT(error_log_id) AS similar_ids", "GROUP_CONCAT(user_id)      AS similar_user_ids", "GROUP_CONCAT(server_ip)    AS similar_server_ips", "MIN(datetime) AS datetime_min", "MAX(datetime) AS datetime_max");
    $error_logs_similar = $ds->loadList($request->makeSelectCount($error_log, $fields));
    $request->setLimit(null);
    $total = count($ds->loadList($request->makeSelectCount($error_log, $fields)));
    $user_ids = array();
    foreach ($error_logs_similar as $_info) {
        $similar_ids = explode(",", $_info["similar_ids"]);
        $error_log = new CErrorLog();
        $error_log->load(reset($similar_ids));
        $error_log->_similar_ids = $similar_ids;
        $error_log->_similar_count = $_info["total"];
        $error_log->_datetime_min = $_info["datetime_min"];
        $error_log->_datetime_max = $_info["datetime_max"];
        $error_log->_similar_user_ids = array_unique(explode(",", $_info["similar_user_ids"]));
        $error_log->_similar_server_ips = array_unique(explode(",", $_info["similar_server_ips"]));
        $error_logs[] = $error_log;
        $user_ids = array_merge($user_ids, $error_log->_similar_user_ids);
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_list_error_logs.php


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