add inventory
This commit is contained in:
@@ -220,4 +220,22 @@ class Helper {
|
||||
$details = json_decode ( Helper::url_get_contents( "http://ipinfo.io/{$ip}/json" ) );
|
||||
return $details;
|
||||
}
|
||||
|
||||
|
||||
public static function mkYiiSortItem($field, $column){
|
||||
return [
|
||||
$field => [
|
||||
'asc' => [$column => SORT_ASC ],
|
||||
'desc' => [$column => SORT_DESC],
|
||||
]
|
||||
];
|
||||
}
|
||||
public static function mkYiiSortItems($config){
|
||||
$result = [];
|
||||
foreach ($config as $col ){
|
||||
$result = $result + Helper::mkYiiSortItem($col[0] ,$col[1]);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user