Просмотр исходного кода

根据最新皮肤-调整并优化随机模板的接口

FengR 2 месяцев назад
Родитель
Сommit
d4d08140d3
1 измененных файлов с 10 добавлено и 6 удалено
  1. 10 6
      app/JsonRpc/PublicRpcService.php

+ 10 - 6
app/JsonRpc/PublicRpcService.php

@@ -3534,15 +3534,17 @@ class PublicRpcService implements PublicRpcServiceInterface
             //     'new' => [  $sort_1,$sort_2,$sort_3]
             // ];
             if($data['page'] == 1 || $data['page'] == '1'){
-                if($toutiao_key){
+                if($toutiao_key && $cat_key){
                     $sector[0] = $toutiao;
                     $sector[$toutiao_key] = $sort_1;
                     $sector[1] = $pic;
                     $sector[$pic_key] = $sort_2;
-                }
-                if($cat_key){
+                }else if($cat_key){
                     $sector[0] = $pic;
                     $sector[$pic_key] = $sort_1;
+                }else{
+                    $sector[0] = $toutiao;
+                    $sector[$toutiao_key] = $sort_1;
                 }
             }
             if ($data['page'] == '2' || $data['page'] == 2 || in_array(5, $sector_specal_sort)) {
@@ -3553,10 +3555,12 @@ class PublicRpcService implements PublicRpcServiceInterface
                     $sector[$toutiao_key] = $sort_2;
                     $sector[2] = $pic;
                     $sector[$pic_key] = $sort_3;
-                }
-                if ($pic_key) {
+                }else if ($pic_key) {
                     $sector[1] = $pic;
                     $sector[$pic_key] = $sort_2;
+                }else{
+                    $sector[1] = $toutiao;
+                    $sector[$toutiao_key] = $sort_2;
                 }
             }
             
@@ -3577,7 +3581,7 @@ class PublicRpcService implements PublicRpcServiceInterface
         var_dump("sector_id",$sector_id);
         return [
             // 'sector_id'=>$sector_id,
-            'sector_count'=>count($sector),
+            // 'sector_count'=>count($sector),
             // 'sectors'=>$sectors,
             // 'sector_comnum'=>$sector_comnum,
             // 'com_num'=>$com_num,