本文整理汇总了PHP中Am_Query::setOrderRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Query::setOrderRaw方法的具体用法?PHP Am_Query::setOrderRaw怎么用?PHP Am_Query::setOrderRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Query
的用法示例。
在下文中一共展示了Am_Query::setOrderRaw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGrid
public function createGrid()
{
$ds = new Am_Query($this->getDi()->countryTable);
$ds->addField('ABS(tag)', 'tag_abs');
$ds->setOrderRaw('tag_abs desc, title');
$grid = new Am_Grid_Editable('_c', ___("Browse Countries"), $ds, $this->_request, $this->view);
$grid->setPermissionId(Am_Auth_Admin::PERM_COUNTRY_STATE);
$grid->addField(new Am_Grid_Field('tag_abs', ___('Sort Order'), true, null, null, '10%'));
$grid->addField(new Am_Grid_Field('title', ___('Title'), true));
$grid->addField(new Am_Grid_Field('country', ___('Code'), true));
$grid->setForm(array($this, 'createForm'));
$grid->actionAdd(new Am_Grid_Action_Url_Country('states', ___('Edit States'), '__ROOT__/admin-states/?country=__COUNTRY__'))->setTarget('_top');
$grid->actionDelete('delete');
$grid->actionDelete('insert');
$grid->addCallback(Am_Grid_ReadOnly::CB_TR_ATTRIBS, array($this, 'getTrAttribs'));
$grid->addCallback(Am_Grid_Editable::CB_VALUES_TO_FORM, array($this, 'valuesToForm'));
$grid->addCallback(Am_Grid_Editable::CB_VALUES_FROM_FORM, array($this, 'valuesFromForm'));
$grid->actionAdd(new Am_Grid_Action_LiveEdit('title'));
$grid->actionAdd(new Am_Grid_Action_Group_CountryEnable(false));
$grid->actionAdd(new Am_Grid_Action_Group_CountryEnable(true));
$grid->setFilter(new Am_Grid_Filter_Text(___('Filter by Counrty Title'), array('title' => 'LIKE')));
return $grid;
}
示例2: createQuery
/**
* @return Am_Query with correct order set
*/
public function createQuery()
{
$q = new Am_Query($this);
$q->setOrderRaw("IF(type='multi', 1, type+0), sort_order");
return $q;
}
示例3: createGrid
public function createGrid()
{
$ds = new Am_Query($this->getDi()->productTable);
$ds->setOrderRaw("0+IFNULL(sort_order,0),title");
$grid = new Am_Grid_Editable('_product', ___("Products"), $ds, $this->_request, $this->view);
$grid->setRecordTitle(___('Product'));
$grid->actionAdd(new Am_Grid_Action_Group_ProductAssignCategory(false));
$grid->actionAdd(new Am_Grid_Action_Group_ProductAssignCategory(true));
$grid->actionAdd(new Am_Grid_Action_Group_Delete());
$grid->addGridField(new Am_Grid_Field('product_id', '#', true, '', null, '5%'));
$grid->addGridField(new Am_Grid_Field('title', ___('Title'), true, '', null, '50%'))->setRenderFunction(array($this, 'renderTitle'));
$grid->addGridField(new Am_Grid_Field('pgroup', ___('Product Categories'), false))->setRenderFunction(array($this, 'renderPGroup'));
$grid->addGridField(new Am_Grid_Field('terms', ___('Default Billing Terms')))->setRenderFunction(array($this, 'renderTerms'));
$grid->addGridField(new Am_Grid_Field('sort_order', ___('Sort Order')));
$grid->actionGet('edit')->setTarget('_top');
$grid->actionAdd(new Am_Grid_Action_LiveEdit('sort_order'));
$grid->setFormValueCallback('start_date', array('RECORD', 'getStartDate'), array('RECORD', 'setStartDate'));
$grid->setFormValueCallback('require_other', array('RECORD', 'unserializeList'), array('RECORD', 'serializeList'));
$grid->setFormValueCallback('prevent_if_other', array('RECORD', 'unserializeList'), array('RECORD', 'serializeList'));
$grid->addCallback(Am_Grid_Editable::CB_AFTER_SAVE, array($this, 'afterSave'));
$grid->addCallback(Am_Grid_Editable::CB_VALUES_TO_FORM, array($this, 'valuesToForm'));
// ->setInputSize(3)->setGetFunction(array($this, 'getSortOrder'));
/// protected $liveEditFields = array('title', 'sort_order');
$grid->setForm(array($this, 'createForm'));
$grid->setFilter(new Am_Grid_Filter_Product());
$grid->actionAdd(new Am_Grid_Action_Url('categories', ___('Edit Groups'), REL_ROOT_URL . '/admin-product-categories'))->setType(Am_Grid_Action_Abstract::NORECORD)->setTarget('_top');
// product upgrades are hidden until fully implemented
// $grid->addCallback(Am_Grid_Editable::CB_RENDER_STATIC, array($this, 'renderProductStatic'));
return $grid;
}