本文整理汇总了PHP中xPDOQuery::andCondition方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDOQuery::andCondition方法的具体用法?PHP xPDOQuery::andCondition怎么用?PHP xPDOQuery::andCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDOQuery
的用法示例。
在下文中一共展示了xPDOQuery::andCondition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareQueryBeforeCount
/**
* @return mixed
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->select($this->modx->getSelectColumns('modManagerLog', 'modManagerLog', '', array('action'), true));
// $c->select($this->modx->getSelectColumns('modManagerLog','modManagerLog'));
$c->select(array('User.username', 'Template.templatename', 'Chunk.name as chunkname', 'Snippet.name as snippetname', 'Plugin.name as pluginname', 'TV.name as tvname'));
$c->innerJoin('modUser', 'User');
$c->leftJoin('modTemplate', 'Template', '`modManagerLog`.item = `Template`.`id` AND `modManagerLog`.`classKey` = "modTemplate"');
$c->leftJoin('modChunk', 'Chunk', '`modManagerLog`.item = `Chunk`.`id` AND `modManagerLog`.`classKey` = "modChunk"');
$c->leftJoin('modSnippet', 'Snippet', '`modManagerLog`.item = `Snippet`.`id` AND `modManagerLog`.`classKey` = "modSnippet"');
$c->leftJoin('modPlugin', 'Plugin', '`modManagerLog`.item = `Plugin`.`id` AND `modManagerLog`.`classKey` = "modPlugin"');
$c->leftJoin('modTemplateVar', 'TV', '`modManagerLog`.item = `TV`.`id` AND `modManagerLog`.`classKey` = "modTemplateVar"');
$query = trim($this->getProperty('query'));
if ($query) {
$c->where('(Template.templatename LIKE "%' . $query . '%" OR Chunk.name LIKE "%' . $query . '%" OR Snippet.name LIKE "%' . $query . '%" OR Plugin.name LIKE "%' . $query . '%" OR TV.name LIKE "%' . $query . '%")');
} else {
$c->where('(modManagerLog.action LIKE "template_%" OR modManagerLog.action LIKE "chunk_%" OR modManagerLog.action LIKE "snippet_%" OR modManagerLog.action LIKE "plugin_%" OR modManagerLog.action LIKE "tv_%")');
}
$user = intval($this->getProperty('user'));
if ($user) {
$c->andCondition(array('modManagerLog.user' => $user));
}
$dateStart = trim($this->getProperty('datestart'));
if ($dateStart) {
$dateStart = date('Y-m-d', strtotime($dateStart));
$c->andCondition(array('modManagerLog.occurred:>=' => $dateStart));
}
$dateEnd = trim($this->getProperty('dateend'));
if ($dateEnd) {
$dateEnd = date('Y-m-d 23:59:59', strtotime($dateEnd));
$c->andCondition(array('modManagerLog.occurred:<=' => $dateEnd));
}
return $c;
}
示例2: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$contextKey = $this->getProperty('cntx');
if (!empty($contextKey)) {
$c->andCondition(array('context_key' => $contextKey));
}
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('id' => $query, 'OR:pagetitle:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例3: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('pattern:LIKE' => '%' . $query . '%', 'OR:target:LIKE' => '%' . $query . '%'));
}
$context = $this->getProperty('context');
if (!empty($context)) {
$c->andCondition(array('context_key:LIKE' => '%' . $context . '%'));
}
return $c;
}
示例4: prepareQueryBeforeCount
/**
* Filter on status and add task data
*
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('sTask', 'Task');
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->select($this->modx->getSelectColumns('sTask', 'Task', 'task_'));
$c->where($this->additionalWhere);
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('Task.reference:LIKE' => '%' . $query . '%'));
}
$namespace = $this->getProperty('namespace');
if (!empty($namespace)) {
$c->andCondition(array('Task.namespace' => $namespace));
}
return $c;
}
示例5: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = trim($this->getProperty('query'));
if ($query !== '') {
$c->andCondition(array('conversation:LIKE' => "%{$query}%"));
}
return $c;
}
示例6: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$form = $this->getProperty('formId');
$startDate = $this->getProperty('startDate');
$endDate = $this->getProperty('endDate');
if (!empty($form)) {
$c->where(array('form_id' => $form));
}
if (!empty($startDate)) {
$c->andCondition(array('senton:>' => date('Y-m-d', strtotime($startDate)) . ' 00:00:00'));
}
if (!empty($endDate)) {
$c->andCondition(array('senton:<' => date('Y-m-d', strtotime($endDate)) . ' 23:59:59'));
}
// var_dump($form, date('Y-m-d H:i:s', strtotime($startDate)), date('Y-m-d H:i:s', strtotime($endDate))); die;
return $c;
}
示例7: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('id' => $query, 'OR:name:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例8: prepareQueryBeforeCount
/**
* Can be used to adjust the query prior to the COUNT statement
*
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('modResource.pagetitle:LIKE' => '%' . $query . '%', 'OR:modResource.longtitle:LIKE' => '%' . $query . '%', 'OR:modResource.menutitle:LIKE' => '%' . $query . '%', 'OR:modResource.description:LIKE' => '%' . $query . '%'));
}
$c->where(array('class_key:=' => 'GridContainer', 'OR:class_key:=' => 'StaticGridContainer'));
return $c;
}
示例9: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('modUser', 'Sender');
$c->where(array('recipient' => $this->modx->user->get('id')));
$search = $this->getProperty('search', '');
if (!empty($search)) {
$c->andCondition(array('subject:LIKE' => '%' . $search . '%', 'OR:message:LIKE' => '%' . $search . '%'), null, 2);
}
return $c;
}
示例10: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->select(array('qsbButton.*', 'Icon.class AS iconcls', 'Icon.path as iconpath'));
$c->leftJoin('qsbIcon', 'Icon');
$c->where(array('set' => $this->getProperty('id')));
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('id' => $query, 'OR:text:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例11: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$form = $this->getProperty('form');
if (!empty($form)) {
$c->where(array('form' => $form));
}
$context_key = $this->getProperty('context_key');
if (!empty($context_key)) {
$c->where(array('context_key' => $context_key));
}
$startDate = $this->getProperty('startDate');
if ($startDate != '') {
$c->andCondition(array('date:>' => strtotime($startDate . ' 00:00:00')));
}
$endDate = $this->getProperty('endDate');
if ($endDate != '') {
$c->andCondition(array('date:<' => strtotime($endDate . ' 23:59:59')));
}
return $c;
}
示例12: prepareQueryBeforeCount
/**
* Only load variations for current test.
*
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
// search
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('reference:LIKE' => '%' . $query . '%', 'OR:description:LIKE' => '%' . $query . '%', 'OR:namespace:LIKE' => '%' . $query . '%'));
}
// filter on class key
$classKey = $this->getProperty('class_key');
if (!empty($classKey)) {
$c->andCondition(array('class_key' => $classKey));
}
// implement runs
$subc = $this->modx->newQuery('sTaskRun');
$subc->select($this->modx->getSelectColumns('sTaskRun', 'sTaskRun', '', array('timing')));
$subc->where(array('status' => sTaskRun::STATUS_SCHEDULED, '`sTaskRun`.`task` = `sTask`.`id`'));
$subc->sortby('timing', 'asc');
$subc->limit(1);
$subc->prepare();
$c->select('(' . $subc->toSQL() . ') AS next_run');
return $c;
}
示例13: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$where = array();
if ($res = $this->getProperty('res')) {
$where['res'] = $res;
}
$where['Language.active'] = 1;
if ($ctx = $this->getProperty('context')) {
$c->leftJoin('XlexiconLanguage', 'Language', "Language.iso_code = {$this->classKey}.language");
$c->andCondition(array('Language.context:REGEXP' => "(^|.+,){$ctx}(,.+|\$)"));
}
$c->where($where);
return $c;
}
示例14: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$cronid = $this->getProperty('cronid');
if (!empty($cronid)) {
$c->where(array('cronjob' => $cronid));
}
$error = $this->getProperty('error', 'all');
if ($error != 'all') {
$c->where(array('error' => $error));
}
$query = $this->getProperty('query');
if (!empty($query)) {
$c->andCondition(array('message:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例15: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$ugns = $this->modx->user->getUserGroupNames();
$userGroupNames = '';
foreach ($ugns as $ugn) {
$userGroupNames .= '"' . $ugn . '",';
}
$userGroupNames = rtrim($userGroupNames, ',');
$c->leftJoin('modUser', 'Author');
$c->leftJoin('modResource', 'Resource');
$c->innerJoin('quipThread', 'Thread');
$c->where(array('quipComment.deleted' => $this->getProperty('deleted', false), 'quipComment.approved' => false));
/* handle moderator permissions */
$c->andCondition(array('(
Thread.moderated = 0
OR Thread.moderator_group IN (' . $userGroupNames . ')
OR "' . $this->modx->user->get('username') . '" IN (Thread.moderators)
)'));
$thread = $this->getProperty('thread');
if (!empty($thread)) {
$c->where(array('quipComment.thread' => $thread));
}
return $c;
}