本文整理汇总了PHP中Am_Query::getAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Query::getAlias方法的具体用法?PHP Am_Query::getAlias怎么用?PHP Am_Query::getAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Query
的用法示例。
在下文中一共展示了Am_Query::getAlias方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
function _getWhere(Am_Query $db)
{
$a = $db->getAlias();
switch ($this->type) {
case 'any':
$c = '';
break;
case 'paid':
$c = 'AND payout_detail_id IS NOT NULL';
break;
case 'not-paid':
$c = 'AND payout_detail_id IS NULL';
break;
}
return "EXISTS\n (SELECT * FROM ?_aff_commission\n WHERE aff_id={$a}.user_id\n {$c})";
}
示例2: addDefaultSort
function addDefaultSort(Am_Query $q)
{
$a = $q->getAlias();
$type = $this->createRecord()->getAccessType();
$q->leftJoin('?_resource_access_sort', "ras", "{$a}.{$this->_key} = ras.resource_id AND ras.resource_type='{$type}'");
$q->addField('ras.sort_order', '_sort_order');
$q->setOrder('_sort_order');
}
示例3: getAlias
private function getAlias(Am_Query $q)
{
return is_null($this->tableAlias) ? $q->getAlias() : $this->tableAlias;
}
示例4: _getWhere
public function _getWhere(Am_Query $q)
{
$a = $q->getAlias();
$ids = array_filter(array_map('intval', $this->ids));
if (!$ids) {
return;
}
$ids = implode(',', $ids);
return "NOT EXISTS (SELECT * FROM ?_user_user_group uug WHERE {$a}.user_id = uug.user_id AND uug.user_group_id IN ({$ids}))";
}
示例5: _getWhere
public function _getWhere(Am_Query $q)
{
if (!$this->ids) {
return null;
}
$a = $q->getAlias();
$ids = join(',', $this->ids);
return "{$a}.user_id IN ({$ids})";
}