作者 jinglong
1 个管道 的构建 通过 耗费 13 秒

优化项目列表接口

... ... @@ -262,6 +262,12 @@ class IndexController extends RestBaseController
}
$acronym =array_values(array_unique($acronym));
sort($acronym);
if(in_array('#',$acronym)){
//去掉第一个
array_shift($acronym);
//增加一个到最后
array_push($acronym,'#');
}
$arr1 = [];
foreach($acronym as $a_key=>$a_value){
$k = 0;
... ... @@ -275,27 +281,7 @@ class IndexController extends RestBaseController
}
}
}
if(in_array('#',$acronym)){
$count = count($acronym);
foreach ($arr1 as $key=>$a_value){
if($a_value['acronym'] == '#'){
$arr1[$count-1] = $a_value;
}else{
$arr1[$key-1] = $a_value;
}
}
foreach($acronym as $key1=>$a_value1){
if($a_value1 == '#'){
$acronym[$count-1] = $a_value1;
}else{
$acronym[$key1-1] = $a_value1;
}
}
}
$arr2['project_a'] = $acronym;
$arr2['project_a'] = $acronym;//首字母数组
$arr2['project_n'] = $arr1;
}
... ...
... ... @@ -66,6 +66,12 @@ class InformationController extends RestBaseController
}
$acronym =array_values(array_unique($acronym));
sort($acronym);
if(in_array('#',$acronym)){
//去掉第一个
array_shift($acronym);
//增加一个到最后
array_push($acronym,'#');
}
$arr1 = [];
foreach($acronym as $a_key=>$a_value){
$k = 0;
... ... @@ -79,26 +85,6 @@ class InformationController extends RestBaseController
}
}
}
if(in_array('#',$acronym)){
$count = count($acronym);
foreach ($arr1 as $key=>$a_value){
if($a_value['acronym'] == '#'){
$arr1[$count-1] = $a_value;
}else{
$arr1[$key-1] = $a_value;
}
}
foreach($acronym as $key1=>$a_value1){
if($a_value1 == '#'){
$acronym[$count-1] = $a_value1;
}else{
$acronym[$key1-1] = $a_value1;
}
}
}
$arr2['project_a'] = $acronym;
$arr2['project_n'] = $arr1;
}
... ...
... ... @@ -74,6 +74,12 @@ class ReportController extends RestBaseController
}
$acronym =array_values(array_unique($acronym));
sort($acronym);
if(in_array('#',$acronym)){
//去掉第一个
array_shift($acronym);
//增加一个到最后
array_push($acronym,'#');
}
$arr1 = [];
foreach($acronym as $a_key=>$a_value){
$k = 0;
... ... @@ -87,25 +93,6 @@ class ReportController extends RestBaseController
}
}
}
if(in_array('#',$acronym)){
$count = count($acronym);
foreach ($arr1 as $key=>$a_value){
if($a_value['acronym'] == '#'){
$arr1[$count-1] = $a_value;
}else{
$arr1[$key-1] = $a_value;
}
}
foreach($acronym as $key1=>$a_value1){
if($a_value1 == '#'){
$acronym[$count-1] = $a_value1;
}else{
$acronym[$key1-1] = $a_value1;
}
}
}
$arr2['title_a'] = $acronym;
$arr2['title_n'] = $arr1;
}
... ...