陈德本 6 anos atrás
pai
commit
1e175eaa23

+ 1 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -1,6 +1,7 @@
 <component name="InspectionProjectProfileManager">
   <profile version="1.0">
     <option name="myName" value="Project Default" />
+    <inspection_tool class="DuplicatedCode" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
     <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
       <option name="processCode" value="true" />
       <option name="processLiterals" value="true" />

+ 4 - 0
App/Api/Controller/Category.php

@@ -31,6 +31,10 @@ class Category extends Controller
         if ($page) {
             $request['page'] = $page;
         }
+        $sort = $this->getQuery()->string("s");
+        if ($sort) {
+            $request['s'] = $sort;
+        }
         $url = Site::getData('site_url') . "/tao.php?" . http_build_query($request);
         $content= Dataoke::parse(file_get_contents($url));
         $this->setCache($content);

+ 18 - 14
App/Api/Controller/Search.php

@@ -12,29 +12,33 @@ class Search extends Controller
 {
     public function main()
     {
-        $kw = $this->getQuery()->string("kw")?:$this->getQuery()->string("args_0");
+        $kw = $this->getQuery()->string("kw") ?: $this->getQuery()->string("args_0");
         $bids = $this->getQuery()->string("bids");
         $cid = $this->getQuery()->string("cid");
-        $page = $this->getQuery()->string("args_1");
-        $request=[
-            'r'=>'l',
-            'u'=>Site::getData("user_tag")
+        $request = [
+            'r' => 'l',
+            'u' => Site::getData("user_tag")
         ];
-        if ($kw){
-            $request['kw']=urldecode($kw);
+        if ($kw) {
+            $request['kw'] = urldecode($kw);
         }
-        if ($bids){
-            $request['bids']=$bids;
+        if ($bids) {
+            $request['bids'] = $bids;
         }
-        if ($cid){
-            $request['cid']=$cid;
+        if ($cid) {
+            $request['cid'] = $cid;
         }
+        $page = $this->getQuery()->string("args_1");
         if ($page){
-            $request['page']=$page;
+            $request['page'] = $page;
+        }
+        $sort = $this->getQuery()->string("s");
+        if ($sort) {
+            $request['s'] = $sort;
         }
 
-        $url = Site::getData('site_url') . "/tao.php?".http_build_query($request);
-        $content= Dataoke::parse(file_get_contents($url));
+        $url = Site::getData('site_url') . "/tao.php?" . http_build_query($request);
+        $content = Dataoke::parse(file_get_contents($url));
         $this->setCache($content);
     }