Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Market: Сортировка в админке #314
Browse files Browse the repository at this point in the history
  • Loading branch information
devkont committed Mar 21, 2017
1 parent 99ceb7e commit a4d81ab
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/market/inc/market.admin.default.php
Expand Up @@ -22,6 +22,8 @@

$sq = cot_import('sq', 'G', 'TXT');

$sort = cot_import('sort', 'G', 'ALP');

$mass_act = cot_import('prd_action', 'P', 'TXT');
$prd_arr = cot_import('prd_arr', 'P', 'ARR');

Expand Down Expand Up @@ -153,7 +155,18 @@
$where['search'] = "(item_title LIKE '".$db->prep($sqlsearch)."' OR item_text LIKE '".$db->prep($sqlsearch)."')";
}

$order['date'] = 'item_date DESC';
switch ($sort) {
case 'costasc':
$order['costasc'] = "item_cost ASC";
break;
case 'costdesc':
$order['costdesc'] = "item_cost DESC";
break;

default:
$order['date'] = "item_date DESC";
break;
}

$list_url_path = array('m' => 'market', 'c' => $c, 'sort' => $sort, 'sq' => $sq, 'state' => $state);

Expand Down

0 comments on commit a4d81ab

Please sign in to comment.