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

Merge branch 'master' of https://git.97admin.com:433/chendeben/taoqu

chendeben 6 лет назад
Родитель
Сommit
32161dbb10
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      App/Api/Model/Dataoke.php

+ 13 - 5
App/Api/Model/Dataoke.php

@@ -39,16 +39,24 @@ class Dataoke
                 $q['original_id'] = $t['original_id'];
             }
 
-            if (count($q) > 0) {
-                $s = "?" . http_build_query($q);
-            } else {
-                $s = "";
-            }
+
             if ($t['kw']) {
+                unset($q['kw']);
+                if (count($q) > 0) {
+                    $s = "?" . http_build_query($q);
+                } else {
+                    $s = "";
+                }
                 $new_url = "/kw/" . $t['kw'] . ".html" . $s;
                 $content = str_replace('"' . $url . '"', '"' . $new_url . '"', $content);
             } else {
                 if ($t['cid']) {
+                    unset($q['cid']);
+                    if (count($q) > 0) {
+                        $s = "?" . http_build_query($q);
+                    } else {
+                        $s = "";
+                    }
                     $new_url = "/category/" . $t['cid'] . ".html".$s;
                     $content = str_replace('"' . $url . '"', '"' . $new_url . '"', $content);
                 } else {