Simple sorting
This commit is contained in:
parent
42b4525a15
commit
12c3862177
|
@ -20,6 +20,8 @@ class ArangoProvider extends yii\data\ActiveDataProvider
|
||||||
*/
|
*/
|
||||||
public $params = [];
|
public $params = [];
|
||||||
|
|
||||||
|
public $sort = '';
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
parent::init();
|
parent::init();
|
||||||
|
@ -116,6 +118,11 @@ class ArangoProvider extends yii\data\ActiveDataProvider
|
||||||
if (count($filter)>0){
|
if (count($filter)>0){
|
||||||
$query .= "\nFILTER ".implode(" && ", $filter)."\n";
|
$query .= "\nFILTER ".implode(" && ", $filter)."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->sort) {
|
||||||
|
$query .= "\n SORT a." . $this->sort;
|
||||||
|
}
|
||||||
|
|
||||||
$statement = $this->arango->statement([
|
$statement = $this->arango->statement([
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
'count' => true,
|
'count' => true,
|
||||||
|
|
Loading…
Reference in New Issue