本文整理汇总了PHP中xPDOQuery::select方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDOQuery::select方法的具体用法?PHP xPDOQuery::select怎么用?PHP xPDOQuery::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDOQuery
的用法示例。
在下文中一共展示了xPDOQuery::select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->rightJoin('modResourceGroup', 'modResourceGroup', 'modResourceGroup.id = msdProductGroup.id');
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->select($this->modx->getSelectColumns('modResourceGroup', 'modResourceGroup'));
return $c;
}
示例2: 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;
}
示例3: 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;
}
示例4: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin("glData", "glData", "glData.identifier = {$this->classKey}.id");
$c->select($this->modx->getSelectColumns("glData", "glData"));
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
switch ($this->classKey) {
case 'glCountry':
break;
case 'glRegion':
$c->leftJoin("glCountry", "glCountry", "glCountry.iso = {$this->classKey}.country");
$c->select($this->modx->getSelectColumns("glCountry", "glCountry", 'country_', array('id'), true));
break;
case 'glCity':
$c->leftJoin("glRegion", "glRegion", "glRegion.id = {$this->classKey}.region_id");
$c->select($this->modx->getSelectColumns("glRegion", "glRegion", 'region_', array('id'), true));
$c->leftJoin("glCountry", "glCountry", "glCountry.iso = glRegion.country");
$c->select($this->modx->getSelectColumns("glCountry", "glCountry", 'country_', array('id'), true));
break;
}
$active = $this->getProperty('active');
if ($active != '') {
$c->where(array("{$this->objectType}.active" => $active));
}
$default = $this->getProperty('default');
if ($default != '') {
$c->where(array("{$this->objectType}.default" => $default));
}
$query = trim($this->getProperty('query'));
if ($query) {
$c->where(array("{$this->objectType}.name_ru:LIKE" => "%{$query}%", "OR:{$this->objectType}.name_en:LIKE" => "%{$query}%"));
}
return $c;
}
示例5: 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;
}
示例6: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin('modResource', 'modResource', 'modResource.id = scContent.resource');
$c->leftJoin('modContentType', 'modContentType', 'modContentType.id = scContent.content_type');
$c->leftJoin('modTemplate', 'modTemplate', 'modTemplate.id = scContent.template');
$c->select($this->modx->getSelectColumns('scContent', 'scContent'));
$c->select(array('resource_name' => 'modResource.pagetitle', 'content_type_name' => 'modContentType.name', 'template_name' => 'modTemplate.templatename'));
/* if ($this->getProperty('combo')) {
$c->select('id,name');
$c->where(array('active' => 1));
if ($requestId = $this->getProperty('request_id')) {
if ($request = $this->modx->getObject('psRequest', $requestId)) {
$status = $request->getOne('Status');
if ($status->get('final') == 1) {
$c->where(array('id' => $status->get('id')));
} else if ($status->get('fixed') == 1) {
$c->where(array('rank:>=' => $status->get('rank')));
}
}
}
}*/
$query = trim($this->getProperty('query'));
if ($query) {
$c->where(array('uri:LIKE' => "%{$query}%", 'OR:pagetitle:LIKE' => "%{$query}%", 'OR:longtitle:LIKE' => "%{$query}%", 'OR:description:LIKE' => "%{$query}%", 'OR:introtext:LIKE' => "%{$query}%", 'OR:content: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->leftJoin('glRegion', 'glRegion', 'glRegion.id = glCity.region_id');
$c->select($this->modx->getSelectColumns('glCity', 'glCity'));
$c->select(array('region_name_ru' => 'glRegion.name_ru'));
$id = $this->getProperty('id');
if (!empty($id) and $this->getProperty('combo')) {
$q = $this->modx->newQuery($this->objectType);
$q->where(array('id!=' => $id));
$q->select('id');
$q->limit(11);
$q->prepare();
$q->stmt->execute();
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN, 0);
$ids = array_merge_recursive(array($id), $ids);
$c->where(array("{$this->objectType}.id:IN" => $ids));
}
$regionId = $this->getProperty('region_id');
if ($regionId != '') {
$c->where("{$this->objectType}.region_id={$regionId}");
}
$active = $this->getProperty('active');
if ($active != '') {
$c->where("{$this->objectType}.active={$active}");
}
$query = trim($this->getProperty('query'));
if ($query) {
$c->where(array("{$this->objectType}.name_ru:LIKE" => "%{$query}%", "OR:{$this->objectType}.name_en:LIKE" => "%{$query}%"));
}
$c->sortby('glCity.active', 'DESC');
$c->sortby('glCity.name_ru', 'ASC');
return $c;
}
示例9: prepareQueryAfterCount
public function prepareQueryAfterCount(xPDOQuery $c)
{
$c->leftJoin('modUserGroupRole', 'Role', array('Role.authority = modAccessContext.authority'));
$c->leftJoin('modAccessPolicy', 'Policy');
$c->select($this->modx->getSelectColumns('modAccessContext', 'modAccessContext'));
$c->select(array('role_name' => 'Role.name', 'policy_name' => 'Policy.name', 'policy_data' => 'Policy.data'));
return $c;
}
示例10: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->where(array('user_id' => $this->getProperty('user_id')));
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->leftJoin('msPayment', 'Payment');
$c->select('Payment.name as payment_name');
return $c;
}
示例11: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->where(array('group_id' => $this->getProperty('group_id')));
$c->leftJoin('msOrder', 'Order');
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->select($this->modx->getSelectColumns('msOrder', 'Order', '', array('num')));
return $c;
}
示例12: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin($this->profitType, $this->profitType, array("{$this->profitType}.group = {$this->classKey}.id", "{$this->profitType}.identifier = {$this->getProperty('identifier')}", "{$this->profitType}.class" => "{$this->classKey}"));
$c->select($this->modx->getSelectColumns($this->profitType, $this->profitType));
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->where(array("{$this->profitType}.profit" => null));
return $c;
}
示例13: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin($this->linkedKey, $this->linkedKey, $this->classKey . '.id = ' . $this->linkedKey . '.id');
$c->leftJoin('msdSaleMember', 'msdSaleMember', array($this->classKey . '.id = msdSaleMember.group_id', 'msdSaleMember.type' => $this->getProperty('type'), 'msdSaleMember.sale_id' => $this->getProperty('sale_id')));
$c->select($this->modx->getSelectColumns($this->linkedKey, $this->linkedKey));
$c->select($this->modx->getSelectColumns($this->classKey, $this->classKey));
$c->where(array('msdSaleMember.sale_id' => null));
return $c;
}
示例14: prepareQueryAfterCount
public function prepareQueryAfterCount(xPDOQuery $c)
{
$c->select($this->modx->getSelectColumns('modUser', 'modUser'));
$c->select(array('usergroup' => 'UserGroup.id', 'usergroup_name' => 'UserGroup.name', 'role' => 'UserGroupRole.id', 'role_name' => 'UserGroupRole.name', 'authority' => 'UserGroupRole.authority'));
if ($this->getProperty('sort') !== 'authority') {
$c->sortby('authority', 'ASC');
}
return $c;
}
示例15: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin('msOrderStatus', 'msOrderStatus', '`msOrderLog`.`entry` = `msOrderStatus`.`id`');
$c->leftJoin('msOrder', 'msOrder', '`msOrder`.`id` = `msOrderLog`.`order_id`');
$c->where(array('order_id' => $this->getProperty('order_id'), 'msOrder.user_id' => $this->modx->user->id, 'action' => 'status'));
$c->select($this->modx->getSelectColumns('msOrderLog', 'msOrderLog', '', array('timestamp', 'action', 'entry')));
$c->select('`msOrderStatus`.`name` as `entry`, `msOrderStatus`.`color`');
return $c;
}