Prechádzať zdrojové kódy

修改友情链接排序

15313670163 2 mesiacov pred
rodič
commit
2d72bf2800
1 zmenil súbory, kde vykonal 8 pridanie a 8 odobranie
  1. 8 8
      app/JsonRpc/WebsiteService.php

+ 8 - 8
app/JsonRpc/WebsiteService.php

@@ -665,14 +665,14 @@ class WebsiteService implements WebsiteServiceInterface
         $where = [
             'website_id' => $data['website_id'],
             'status' => 1,
-            'type' => $data['type'],
-        ];
-        $num = $data['num'];
-        $result = Link::where($where)->orderBy('id')->limit($num)->get();
-        if (!empty($result)) {
-            return Result::success($result);
-        } else {
-            return Result::error("本网站暂无此类型友情链接", 0);
+            'type' => $data['type'] 
+        ]; 
+        $num=$data['num'];
+        $result=Link::where($where)->orderBy('sort')->limit($num)->get(); 
+        if(!empty($result)){ 
+            return Result::success($result);  
+        }else{ 
+            return Result::error("本网站暂无此类型友情链接",0); 
         }
     }