diff options
author | V.Krishn <vkrishn4@gmail.com> | 2016-07-09 19:59:16 +0530 |
---|---|---|
committer | V.Krishn <vkrishn4@gmail.com> | 2016-07-09 19:59:16 +0530 |
commit | c9248a0c1d6c6c92c4e4394676cc37a005305f2f (patch) | |
tree | 02fcf505c0aea0ffd5fc116d65add09950c7ffc6 | |
parent | 903c59f2ae54fa3e7fcfa71e93b28e9a66b3f8b3 (diff) | |
download | aport-api-c9248a0c1d6c6c92c4e4394676cc37a005305f2f.tar.bz2 |
code clean
-rw-r--r-- | index.php | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1144,11 +1144,9 @@ function get_all_category() { $cats = array(); # get all Repoversions available $res = Repoversion::find(); - foreach($res as $m1) { - foreach($t as $t1) { $m[$t1][] = $m1->$t1; } + foreach($t as $t1) { + $cats[$t1] = array_unique(array_column($res->toArray(), $t1)); } - foreach($t as $t1) { $cats[$t1] = array_values(array_unique($m[$t1])); } - unset($m, $m1, $res); return $cats; } |