本文整理汇总了PHP中xPDOQuery::orCondition方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDOQuery::orCondition方法的具体用法?PHP xPDOQuery::orCondition怎么用?PHP xPDOQuery::orCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDOQuery
的用法示例。
在下文中一共展示了xPDOQuery::orCondition方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin('modUserProfile', 'Profile');
$query = $this->getProperty('query', '');
if (!empty($query)) {
$c->where(array('modUser.username:LIKE' => '%' . $query . '%'));
$c->orCondition(array('Profile.fullname:LIKE' => '%' . $query . '%'));
$c->orCondition(array('Profile.email:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例2: prepareQueryBeforeCount
/** {@inheritDoc} */
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->where(array('class_key' => 'msProduct'));
$c->leftJoin('msProductData', 'Data', 'msProduct.id = Data.id');
$c->leftJoin('msCategoryMember', 'Member', 'msProduct.id = Member.product_id');
$c->leftJoin('msVendor', 'Vendor', 'Data.vendor = Vendor.id');
$c->leftJoin('msCategory', 'Category', 'Category.id = msProduct.parent');
if ($this->getProperty('combo')) {
$c->select('msProduct.id,msProduct.pagetitle,msProduct.context_key');
} else {
$c->select($this->modx->getSelectColumns('msProduct', 'msProduct'));
$c->select($this->modx->getSelectColumns('msProductData', 'Data', '', array('id'), true));
$c->select($this->modx->getSelectColumns('msVendor', 'Vendor', 'vendor_', array('name')));
$c->select($this->modx->getSelectColumns('msCategory', 'Category', 'category_', array('pagetitle')));
}
if ($query = $this->getProperty('query', null)) {
$queryWhere = array('msProduct.id' => $query, 'OR:msProduct.pagetitle:LIKE' => '%' . $query . '%', 'OR:description:LIKE' => '%' . $query . '%', 'OR:introtext:LIKE' => '%' . $query . '%', 'OR:Data.article:LIKE' => '%' . $query . '%', 'OR:Data.vendor:LIKE' => '%' . $query . '%', 'OR:Data.made_in:LIKE' => '%' . $query . '%', 'OR:Vendor.name:LIKE' => '%' . $query . '%', 'OR:Category.pagetitle:LIKE' => '%' . $query . '%');
$c->where($queryWhere);
}
$parent = $this->getProperty('parent');
if (!empty($parent)) {
$category = $this->modx->getObject('modResource', $this->getProperty('parent'));
$this->parent = $parent;
$parents = array($parent);
if ($this->modx->getOption('ms2_category_show_nested_products', null, true)) {
$tmp = $this->modx->getChildIds($parent, 10, array('context' => $category->get('context_key')));
foreach ($tmp as $v) {
$parents[] = $v;
}
}
$c->orCondition(array('parent:IN' => $parents, 'Member.category_id:IN' => $parents), '', 1);
}
return $c;
}
示例3: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin('modUserProfile', 'Profile');
$query = $this->getProperty('query', '');
if (!empty($query)) {
$c->where(array('modUser.username:LIKE' => '%' . $query . '%'));
$c->orCondition(array('Profile.fullname:LIKE' => '%' . $query . '%'));
$c->orCondition(array('Profile.email:LIKE' => '%' . $query . '%'));
}
$userGroup = $this->getProperty('usergroup', 0);
if (!empty($userGroup)) {
$c->innerJoin('modUserGroupMember', 'UserGroupMembers');
$c->where(array('UserGroupMembers.user_group' => $userGroup));
}
return $c;
}
示例4: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($linkType = $this->getProperty('link_type', false)) {
$templates = array();
$resources = array();
if ($linkType === 'res-chunk') {
$templates = $this->getParentsByLink('temp-chunk');
$templates = array_merge($templates, $this->getParentsByLink('chunk-chunk', 'temp-chunk'));
$resources = $this->getParentsByLink('res-chunk');
} else {
if ($linkType === 'res-snip') {
$templates = $this->getParentsByLink('temp-snip');
$templates = array_merge($templates, $this->getParentsByLink('chunk-snip', 'temp-chunk'));
$resources = $this->getParentsByLink('res-snip');
}
}
$templates = array_unique($templates);
$tempCount = count($templates);
$resCount = count($resources);
if ($tempCount == 0 && $resCount == 0) {
$c->where(array('id' => 0));
} else {
if ($tempCount > 0) {
$c->where(array('template:IN' => $templates));
}
if ($resCount > 0) {
$c->orCondition(array('id:IN' => $resources));
}
}
} else {
$c->where(array('template' => $this->getProperty('id')));
}
return $c;
}
示例5: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->where(array('modDashboardWidget.name:LIKE' => '%' . $query . '%'));
$c->orCondition(array('modDashboardWidget.description:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例6: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->where(array('modMediaSource.name:LIKE' => '%' . $query . '%'));
$c->orCondition(array('modMediaSource.description:LIKE' => '%' . $query . '%'));
}
if ($this->getProperty('streamsOnly')) {
$c->where(array('modMediaSource.is_stream' => true));
}
return $c;
}
示例7: prepareQueryAfterCount
public function prepareQueryAfterCount(xPDOQuery $c)
{
$query = $this->getProperty('query');
if (!empty($query)) {
$c->where(array('modDashboard.name:LIKE' => '%' . $query . '%'));
$c->orCondition(array('modDashboard.description:LIKE' => '%' . $query . '%'));
}
$userGroup = $this->getProperty('usergroup', false);
if (!empty($userGroup)) {
$c->innerJoin('modUserGroup', 'UserGroups');
$c->where(array('UserGroups.id' => $userGroup));
}
return $c;
}
示例8: prepareQueryBeforeCount
/** {@inheritDoc} */
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($master = $this->getProperty('master')) {
$c->orCondition(array('master' => $master, 'slave' => $master));
}
$c->innerJoin('msLink', 'msLink', 'msProductLink.link=msLink.id');
$c->leftJoin('msProduct', 'Master', 'Master.id=msProductLink.master');
$c->leftJoin('msProduct', 'Slave', 'Slave.id=msProductLink.slave');
$c->select($this->modx->getSelectColumns('msProductLink', 'msProductLink'));
$c->select($this->modx->getSelectColumns('msLink', 'msLink', '', array('id'), true));
$c->select('`Master`.`pagetitle` as `master_pagetitle`, `Slave`.`pagetitle` as `slave_pagetitle`');
return $c;
}