本文整理匯總了PHP中Piwik\Db::segmentedFetchFirst方法的典型用法代碼示例。如果您正苦於以下問題:PHP Db::segmentedFetchFirst方法的具體用法?PHP Db::segmentedFetchFirst怎麽用?PHP Db::segmentedFetchFirst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Db
的用法示例。
在下文中一共展示了Db::segmentedFetchFirst方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDeleteIdVisitOffset
/**
* get highest idVisit to delete rows from
* @return string
*/
private function getDeleteIdVisitOffset()
{
$logVisit = Common::prefixTable("log_visit");
// get max idvisit
$maxIdVisit = Db::fetchOne("SELECT MAX(idvisit) FROM {$logVisit}");
if (empty($maxIdVisit)) {
return false;
}
// select highest idvisit to delete from
$dateStart = Date::factory("today")->subDay($this->deleteLogsOlderThan);
$sql = "SELECT idvisit\n\t\t FROM {$logVisit}\n\t\t WHERE '" . $dateStart->toString('Y-m-d H:i:s') . "' > visit_last_action_time\n\t\t AND idvisit <= ?\n\t\t AND idvisit > ?\n\t\t ORDER BY idvisit DESC\n\t\t LIMIT 1";
return Db::segmentedFetchFirst($sql, $maxIdVisit, 0, -self::$selectSegmentSize);
}
示例2: getDeleteIdVisitOffset
public function getDeleteIdVisitOffset($date, $maxIdVisit, $segmentSize)
{
$sql = 'SELECT idvisit ' . 'FROM ' . $this->table . ' ' . "WHERE '" . $date . "' > visit_last_action_time " . ' AND idvisit <= ? ' . ' AND idvisit > ? ' . 'ORDER BY idvisit DESC ' . 'LIMIT 1';
return Db::segmentedFetchFirst($sql, $maxIdVisit, 0, $segmentSize);
}