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


PHP xPDOQuery::andCondition方法代码示例

本文整理汇总了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;
 }
开发者ID:sergant210,项目名称:AdminTools,代码行数:36,代码来源:getlist.class.php

示例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;
 }
开发者ID:DrAndromeda,项目名称:4-20.com.ua,代码行数:12,代码来源:getlist.class.php

示例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;
 }
开发者ID:DrAndromeda,项目名称:4-20.com.ua,代码行数:12,代码来源:getlist.class.php

示例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;
 }
开发者ID:sebastian-marinescu,项目名称:Scheduler,代码行数:22,代码来源:future.class.php

示例5: prepareQueryBeforeCount

 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $query = trim($this->getProperty('query'));
     if ($query !== '') {
         $c->andCondition(array('conversation:LIKE' => "%{$query}%"));
     }
     return $c;
 }
开发者ID:jolichter,项目名称:modxTalks,代码行数:8,代码来源:getlist.class.php

示例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;
 }
开发者ID:doksec,项目名称:formz,代码行数:17,代码来源:export.class.php

示例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;
 }
开发者ID:Realetive,项目名称:QuickstartButtons,代码行数:8,代码来源:getlist.class.php

示例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;
 }
开发者ID:RuGa,项目名称:GridClassKey,代码行数:15,代码来源:getlist.class.php

示例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;
 }
开发者ID:adamwintle,项目名称:flexibility5,代码行数:10,代码来源:getlist.class.php

示例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;
 }
开发者ID:Realetive,项目名称:QuickstartButtons,代码行数:11,代码来源:getlist.class.php

示例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;
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:20,代码来源:getlist.class.php

示例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;
 }
开发者ID:sebastian-marinescu,项目名称:Scheduler,代码行数:29,代码来源:getlist.class.php

示例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;
 }
开发者ID:bendasvadim,项目名称:MODX.Xlexicon,代码行数:14,代码来源:getlist.class.php

示例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;
 }
开发者ID:rtripault,项目名称:MODx-CronManager,代码行数:16,代码来源:getlog.class.php

示例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;
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:24,代码来源:getunapproved.class.php


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