Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/cat_dbitem_export_helper.php
Show First 20 Lines • Show All 525 Lines • ▼ Show 20 Line(s) | |||||
else { | else { | ||||
foreach ($this->exportOptions['export_cats_ids'] as $category_id) { | foreach ($this->exportOptions['export_cats_ids'] as $category_id) { | ||||
$sql .= '(c.ParentPath LIKE "%|' . $category_id . '|%") OR '; | $sql .= '(c.ParentPath LIKE "%|' . $category_id . '|%") OR '; | ||||
} | } | ||||
$sql = substr($sql, 0, -4); | $sql = substr($sql, 0, -4); | ||||
} | } | ||||
$sql .= ' ORDER BY ci.PrimaryCat DESC'; // NEW | $sql .= ' ORDER BY ci.PrimaryCat DESC, c.TreeLeft ASC, item_table.' . $this->curItem->IDField . ' ASC'; | ||||
} | } | ||||
else { | else { | ||||
// get only selected links | // get only selected links | ||||
$sql = 'SELECT item_table.*, ' . $this->exportOptions['export_cats_ids'][0] . ' AS CategoryId | $sql = 'SELECT item_table.*, ' . $this->exportOptions['export_cats_ids'][0] . ' AS CategoryId | ||||
FROM ' . $this->curItem->TableName . ' item_table | FROM ' . $this->curItem->TableName . ' item_table | ||||
WHERE ' . $this->curItem->IDField . ' IN (' . implode(',', $this->exportOptions['export_ids']) . ')'; | WHERE ' . $this->curItem->IDField . ' IN (' . implode(',', $this->exportOptions['export_ids']) . ')'; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1041 Lines • Show Last 20 Lines |