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