本文整理汇总了PHP中FOFModel::buildQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP FOFModel::buildQuery方法的具体用法?PHP FOFModel::buildQuery怎么用?PHP FOFModel::buildQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOFModel
的用法示例。
在下文中一共展示了FOFModel::buildQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuery
/**
* Builds the SELECT query
*
* @param boolean $overrideLimits Are we requested to override the set limits?
*
* @return JDatabaseQuery
*
* @since 3.2
*/
public function buildQuery($overrideLimits = false)
{
$query = parent::buildQuery($overrideLimits);
$db = $this->getDbo();
// Add a forced extension filtering to the list
$eid = $this->getState('eid', 700);
$query->where($db->qn('extension_id') . ' = ' . $db->q($eid));
// Force filter only enabled messages
$published = $this->getState('published', 1, 'int');
$query->where($db->qn('enabled') . ' = ' . $db->q($published));
return $query;
}
示例2: buildQuery
/**
* ajust the query
*
* @param boolean $overrideLimits Are we requested to override the set limits?
*
* @return JDatabaseQuery
*/
public function buildQuery($overrideLimits = false)
{
// If SEF is enabled then start is a state var and will be used as filter from FOF
$this->blacklistFilters('start');
$query = parent::buildQuery($overrideLimits);
$db = $this->getDbo();
$task = $this->getState('task');
$formName = $this->getState('form_name');
if (FOFPlatform::getInstance()->isBackend()) {
// Filter on catid
$catid = (int) $this->input->get('category');
if ($catid != 0) {
$query->where($db->qn('catid') . ' = ' . $catid);
}
return $query;
}
if (FOFPlatform::getInstance()->isFrontend()) {
$query->where($db->qn('enabled') . ' = 1');
if (!in_array($formName, array('form.search', 'form.export'))) {
$now = JFactory::getDate()->format("Y-m-d");
$query->where('(' . $db->qn('sdate') . ' >= ' . "'{$now}'" . ' OR ' . $db->qn('edate') . ' >= ' . "'{$now}'" . ')');
return $query;
}
// Search or export form
$isfreeofcharge = $this->input->get('s_isfreeofcharge', 0);
if ($isfreeofcharge == 1) {
$query->where($db->qn('isfreeofcharge') . ' = 1');
}
$sdate = $this->input->get('s_sdate');
if ($sdate == '') {
$sdate = JFactory::getDate()->format("Y-m-d");
} else {
$sdate = $this->formatDate($sdate);
}
$query->where($db->qn('sdate') . ' >= ' . $db->q($sdate));
$edate = $this->input->get('s_edate');
if ($edate != '') {
$query->where($db->qn('edate') . ' <= ' . $db->q($edate));
} else {
$edate = $this->formatDate($edate);
}
$pcodefrom = $this->input->get('pcodefrom');
if ($pcodefrom != '') {
$query->where($db->qn('pcode') . ' >= ' . $db->q($pcodefrom));
}
$pcodeupto = $this->input->get('pcodeupto');
if ($pcodeupto != '') {
$query->where($db->qn('pcode') . ' <= ' . $db->q($pcodeupto));
}
$fulltext = $this->input->get('fulltext', '', 'string');
if ($fulltext != '') {
$fulltext = '%' . $fulltext . '%';
$query->where('(' . $db->qn('name') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('organiser') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('contact') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('ainfo') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('street') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('pcode') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('city') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('state') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('country') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('teaser') . ' like ' . $db->q($fulltext) . ') OR (' . $db->qn('text') . ' like ' . $db->q($fulltext) . ')');
}
$excatid = (array) $this->input->get('excatid');
if (!empty($excatid)) {
$excatid = array_map('intval', $excatid);
$excatid = implode(',', $excatid);
$query->where($db->qn('catid') . ' IN ' . '(' . $excatid . ')');
}
}
return $query;
}
示例3: buildQuery
public function buildQuery($overrideLimits = false)
{
return parent::buildQuery();
}