陈德本 6 years ago
parent
commit
7b9f176389
2 changed files with 13 additions and 2 deletions
  1. 2 1
      App/Api/Controller/Category.php
  2. 11 1
      App/Api/Model/Dataoke.php

+ 2 - 1
App/Api/Controller/Category.php

@@ -13,7 +13,8 @@ class Category extends Controller
     protected function main()
     {
         $id = $this->getQuery()->intval("id");
-        $url = sprintf(Site::getData('site_url') . "/tao.php?r=l&cid=%d&site=classify", $id);
+        $original_id = $this->getQuery()->intval("original_id");
+        $url = sprintf(Site::getData('site_url') . "/tao.php?r=l&cid=%d&original_id=%s&site=classify", $id, $original_id);
         echo Dataoke::parse(file_get_contents($url));
     }
 

+ 11 - 1
App/Api/Model/Dataoke.php

@@ -53,7 +53,17 @@ class Dataoke
                 $content = str_replace('"' . $url . '"', '"' . $new_url . '"', $content);
             } else {
                 if ($t['cid']) {
-                    $new_url = "/category/" . $t['cid'] . ".html";
+                    $q = [];
+                    //http://www.taoqu88.com/tao.php?r=l&cid=4&s=t&u=1350274&original_id=8150
+                    if ($t['original_id']){
+                        $q['original_id'] = $t['original_id'];
+                    }
+                    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 {
                     if ($t['id']) {