本文整理汇总了PHP中xPDOQuery::innerJoin方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDOQuery::innerJoin方法的具体用法?PHP xPDOQuery::innerJoin怎么用?PHP xPDOQuery::innerJoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDOQuery
的用法示例。
在下文中一共展示了xPDOQuery::innerJoin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('galAlbumItem', 'AlbumItems', array('galItem.id = AlbumItems.item', 'AlbumItems.album' => $this->getProperty('album')));
$c->innerJoin('galAlbum', 'Album', array('Album.id = AlbumItems.album'));
$c->leftJoin('galTag', 'Tags');
return $c;
}
示例2: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('modUserGroupRole', 'UserGroupRole');
$c->innerJoin('modUserGroup', 'UserGroup');
$c->innerJoin('modUser', 'User', array('User.id' => 'modUserGroupMember.member', 'User.id' => $this->getProperty('user')));
$c->where(array('modUserGroupMember.member' => $this->getProperty('user')));
return $c;
}
示例3: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->where(array('referrer_id' => $this->getProperty('referrer_id')));
$c->groupby($this->classKey . '.id');
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->innerJoin('modUser', 'User', $this->classKey . '.id = User.id');
$c->select('User.username');
$c->innerJoin('modUserProfile', 'UserProfile', $this->classKey . '.id = UserProfile.internalKey');
$c->select('UserProfile.fullname');
return $c;
}
示例4: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('modUser', 'User');
$c->innerJoin('modUserProfile', 'UserProfile');
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->select(array('username' => 'User.username', 'fullname' => 'UserProfile.fullname', 'active' => 'User.active', 'blocked' => 'UserProfile.blocked'));
if ($query = $this->getProperty('query', null)) {
$c->where(array('User.username:LIKE' => "%{$query}%", 'OR:UserProfile.fullname:LIKE' => "%{$query}%"));
}
return $c;
}
示例5: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('modUserGroupMember', 'UserGroupMembers');
$c->innerJoin('modUserGroup', 'UserGroup', 'UserGroupMembers.user_group = UserGroup.id');
$c->leftJoin('modUserGroupRole', 'UserGroupRole', 'UserGroupMembers.role = UserGroupRole.id');
$userGroup = $this->getProperty('usergroup', 0);
$c->where(array('UserGroupMembers.user_group' => $userGroup));
$username = $this->getProperty('username', '');
if (!empty($username)) {
$c->where(array('modUser.username:LIKE' => '%' . $username . '%'));
}
return $c;
}
示例6: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('modAccessPolicyTemplate', 'Template');
$group = $this->getProperty('group');
if (!empty($group)) {
$group = is_array($group) ? $group : explode(',', $group);
$c->innerJoin('modAccessPolicyTemplateGroup', 'TemplateGroup', 'TemplateGroup.id = Template.template_group');
$c->where(array('TemplateGroup.name:IN' => $group));
}
$query = $this->getProperty('query', '');
if (!empty($query)) {
$c->where(array('modAccessPolicy.name:LIKE' => '%' . $query . '%', 'OR:modAccessPolicy.description:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例7: 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;
}
示例8: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('sxNewsletter', 'sxNewsletter', 'sxNewsletter.id = sxQueue.newsletter_id');
$c->select($this->modx->getSelectColumns('sxQueue', 'sxQueue'));
$c->select('sxNewsletter.name as newsletter');
return $c;
}
示例9: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->select(array('qsbSetUserGroup.*', 'UserGroup.name'));
$c->innerJoin('modUserGroup', 'UserGroup');
$c->where(array('set' => $this->getProperty('id')));
return $c;
}
示例10: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin('modMediaSource', 'Source');
$c->leftJoin($this->classKey, 'Thumb', "`{$this->classKey}`.`id` = `Thumb`.`parent`");
$c->groupby($this->classKey . '.id');
$c->select('`Source`.`name` as `source_name`');
$c->select('`Thumb`.`url` as `thumbnail`');
$c->where(array('resource_id' => $this->getProperty('resource_id')));
$parent = $this->getProperty('parent');
if ($parent !== false) {
$c->where(array('parent' => $parent));
}
$query = trim($this->getProperty('query'));
if (!empty($query)) {
$c->where(array('file:LIKE' => "%{$query}%", 'OR:name:LIKE' => "%{$query}%", 'OR:alt:LIKE' => "%{$query}%", 'OR:description:LIKE' => "%{$query}%", 'OR:add:LIKE' => "%{$query}%"));
}
$tags = array_map('trim', explode(',', $this->getProperty('tags')));
if (!empty($tags[0])) {
$tags = implode("','", $tags);
$c->innerJoin('msResourceFileTag', 'Tag', "`{$this->classKey}`.`id` = `Tag`.`file_id` AND `Tag`.`tag` IN ('" . $tags . "')");
$c->groupby($this->classKey . '.id');
$c->prepare();
$this->modx->log(1, $c->toSQL());
}
return $c;
}
示例11: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('modAccessPolicyTemplateGroup', 'TemplateGroup');
$query = $this->getProperty('query', '');
if (!empty($query)) {
$c->where(array('modAccessPolicyTemplate.name:LIKE' => '%' . $query . '%', 'OR:modAccessPolicyTemplate.description:LIKE' => '%' . $query . '%'));
}
return $c;
}
示例12: 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;
}
示例13: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('msOrder', 'msOrder', '`msOrderProduct`.`order_id` = `msOrder`.`id`');
$c->leftJoin('msProduct', 'msProduct', '`msOrderProduct`.`product_id` = `msProduct`.`id`');
$c->leftJoin('msProductData', 'msProductData', '`msOrderProduct`.`product_id` = `msProductData`.`id`');
$c->where(array('order_id' => $this->getProperty('order_id'), 'msOrder.user_id' => $this->modx->user->id));
$c->select($this->modx->getSelectColumns('msOrderProduct', 'msOrderProduct'));
$c->select($this->modx->getSelectColumns('msProduct', 'msProduct', 'product_'));
$c->select($this->modx->getSelectColumns('msProductData', 'msProductData', 'product_', array('id'), true));
return $c;
}
示例14: prepareQueryBeforeCount
/**
* Can be used to adjust the query prior to the COUNT statement
*
* @param xPDOQuery $c
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$props = $this->getProperties();
if (!empty($props['tagId'])) {
$c->where(array('tag_id' => $props['tagId']));
}
if (!empty($props['tvId'])) {
$c->where(array('tmplvar_id' => $props['tvId']));
}
$c->innerJoin('smarttagResource', 'smarttagResource', 'smarttagResource.id = smarttagTagresources.resource_id');
$c->select(array('smarttagTagresources.*', 'smarttagResource.pagetitle'));
return $c;
}
示例15: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
* @return \xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->innerJoin('disCategory', 'Category');
$c->leftJoin('disBoard', 'Parent');
$c->select($this->modx->getSelectColumns('disBoard', 'disBoard', '', array('id', 'name')));
$c->select($this->modx->getSelectColumns('disCategory', 'Category', 'category_', array('id', 'name')));
$c->select($this->modx->getSelectColumns('disBoard', 'Parent', 'parent_', array('id', 'name')));
$query = $this->getProperty('query');
if (!empty($query)) {
$c->where(array('disBoard.name:LIKE' => "%{$query}%"));
}
return $c;
}