本文整理汇总了PHP中AdminTab::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminTab::getList方法的具体用法?PHP AdminTab::getList怎么用?PHP AdminTab::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminTab
的用法示例。
在下文中一共展示了AdminTab::getList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
$orderByPriceFinal = empty($orderBy) ? Tools::getValue($this->table . 'Orderby', 'id_' . $this->table) : $orderBy;
$orderWayPriceFinal = empty($orderWay) ? Tools::getValue($this->table . 'Orderway', 'ASC') : $orderWay;
if ($orderByPriceFinal == 'price_final') {
$orderBy = 'id_' . $this->table;
$orderWay = 'ASC';
}
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit);
/* update product quantity with attributes ...*/
if ($this->_list) {
$nb = count($this->_list);
for ($i = 0; $i < $nb; $i++) {
Attribute::updateQtyProduct($this->_list[$i]);
}
/* update product final price */
for ($i = 0; $i < $nb; $i++) {
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], $usetax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false, $usereduc = true, $quantity = 1, $forceAssociatedTax = true);
}
}
if ($orderByPriceFinal == 'price_final') {
if (strtolower($orderWayPriceFinal) == 'desc') {
uasort($this->_list, 'cmpPriceDesc');
} else {
uasort($this->_list, 'cmpPriceAsc');
}
}
for ($i = 0; $this->_list and $i < $nb; $i++) {
$this->_list[$i]['price_final'] = $this->_list[$i]['price_tmp'];
unset($this->_list[$i]['price_tmp']);
}
}
示例2: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
global $cookie;
$orderByPriceFinal = empty($orderBy) ? $cookie->__get($this->table . 'Orderby') ? $cookie->__get($this->table . 'Orderby') : 'id_' . $this->table : $orderBy;
$orderWayPriceFinal = empty($orderWay) ? $cookie->__get($this->table . 'Orderway') ? $cookie->__get($this->table . 'Orderby') : 'ASC' : $orderWay;
if ($orderByPriceFinal == 'price_final') {
$orderBy = 'id_' . $this->table;
$orderWay = 'ASC';
}
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit);
/* update product quantity with attributes ...*/
if ($this->_list) {
$nb = count($this->_list);
for ($i = 0; $i < $nb; $i++) {
Attribute::updateQtyProduct($this->_list[$i]);
}
/* update product final price */
for ($i = 0; $i < $nb; $i++) {
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, NULL, 6, NULL, false, true, 1, true);
}
}
if ($orderByPriceFinal == 'price_final') {
if (strtolower($orderWayPriceFinal) == 'desc') {
uasort($this->_list, 'cmpPriceDesc');
} else {
uasort($this->_list, 'cmpPriceAsc');
}
}
for ($i = 0; $this->_list and $i < $nb; $i++) {
$this->_list[$i]['price_final'] = $this->_list[$i]['price_tmp'];
unset($this->_list[$i]['price_tmp']);
}
}
示例3: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
parent::getList((int) $id_lang, $orderBy, $orderWay, $start, $limit);
if (sizeof($this->_list)) {
$this->_productAttachements = Attachment::getProductAttached((int) $id_lang, $this->_list);
}
}
示例4: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
global $cookie;
return parent::getList((int) $cookie->id_lang, !Tools::getValue($this->table . 'Orderby') ? 'date_add' : NULL, !Tools::getValue($this->table . 'Orderway') ? 'DESC' : NULL);
}
示例5: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
global $cookie;
parent::getList((int) $cookie->id_lang, !$cookie->__get($this->table . 'Orderby') ? 'position' : NULL, !$cookie->__get($this->table . 'Orderway') ? 'ASC' : NULL);
}
示例6: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit);
global $cookie;
/* Manage default params values */
if (empty($limit)) {
$limit = !isset($cookie->{$this->table . '_pagination'}) ? $this->_pagination[0] : ($limit = $cookie->{$this->table . '_pagination'});
}
if (!Validate::isTableOrIdentifier($this->table)) {
die('filter is corrupted');
}
if (empty($orderBy)) {
$orderBy = Tools::getValue($this->table . 'Orderby', 'id_' . $this->table);
}
if (empty($orderWay)) {
$orderWay = Tools::getValue($this->table . 'Orderway', 'ASC');
}
$limit = intval(Tools::getValue('pagination', $limit));
$cookie->{$this->table . '_pagination'} = $limit;
/* Check params validity */
if (!Validate::isOrderBy($orderBy) or !Validate::isOrderWay($orderWay) or !is_numeric($start) or !is_numeric($limit) or !Validate::isUnsignedId($id_lang)) {
die(Tools::displayError('get list params is not valid'));
}
/* Determine offset from current page */
if ((isset($_POST['submitFilter' . $this->table]) or isset($_POST['submitFilter' . $this->table . '_x']) or isset($_POST['submitFilter' . $this->table . '_y'])) and !empty($_POST['submitFilter' . $this->table]) and is_numeric($_POST['submitFilter' . $this->table])) {
$start = intval($_POST['submitFilter' . $this->table] - 1) * $limit;
}
/* Cache */
$this->_lang = intval($id_lang);
$this->_orderBy = $orderBy;
$this->_orderWay = Tools::strtoupper($orderWay);
/* SQL table : orders, but class name is Order */
$sqlTable = $this->table == 'order' ? 'orders' : $this->table;
/* Query in order to get results number */
$queryTotal = Db::getInstance()->getRow('
SELECT COUNT(a.`id_' . $this->table . '`) AS total
FROM `' . _DB_PREFIX_ . $sqlTable . '` a
' . ($this->lang ? 'LEFT JOIN `' . _DB_PREFIX_ . $this->table . '_lang` b ON (b.`id_' . $this->table . '` = a.`id_' . $this->table . '` AND b.`id_lang` = ' . intval($id_lang) . ')' : '') . '
' . (isset($this->_join) ? $this->_join . ' ' : '') . '
WHERE 1 ' . (isset($this->_where) ? $this->_where . ' ' : '') . (($this->deleted or $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '') . $this->_filter . '
' . (isset($this->_group) ? $this->_group . ' ' : '') . '
' . (isset($this->addressType) ? 'AND a.id_' . strval($this->addressType) . ' != 0' : ''));
$this->_listTotal = intval($queryTotal['total']);
/* Query in order to get results with all fields */
$this->_list = Db::getInstance()->ExecuteS('
SELECT a.*' . ($this->lang ? ', b.*' : '') . (isset($this->_select) ? ', ' . $this->_select . ' ' : '') . '
FROM `' . _DB_PREFIX_ . $sqlTable . '` a
' . ($this->lang ? 'LEFT JOIN `' . _DB_PREFIX_ . $this->table . '_lang` b ON (b.`id_' . $this->table . '` = a.`id_' . $this->table . '` AND b.`id_lang` = ' . intval($id_lang) . ')' : '') . '
' . (isset($this->_join) ? $this->_join . ' ' : '') . '
WHERE 1 ' . (isset($this->_where) ? $this->_where . ' ' : '') . (($this->deleted or $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '') . $this->_filter . '
' . (isset($this->_group) ? $this->_group . ' ' : '') . '
' . (isset($this->addressType) ? 'AND a.id_' . strval($this->addressType) . ' != 0' : '') . '
ORDER BY ' . ($orderBy == 'id_' . $this->table ? 'a.' : '') . '`' . pSQL($orderBy) . '` ' . pSQL($orderWay) . '
LIMIT ' . intval($start) . ',' . intval($limit));
}