|
@@ -13,6 +13,39 @@ class ClassifyController extends Controller
|
13
|
13
|
return Classify::paginate(100);
|
14
|
14
|
}
|
15
|
15
|
|
|
16
|
+ /**
|
|
17
|
+ * 每页20进行分页
|
|
18
|
+ * @param Request $request
|
|
19
|
+ * @return mixed
|
|
20
|
+ */
|
|
21
|
+ public function home(Request $request)
|
|
22
|
+ {
|
|
23
|
+ $top = Classify::where("location", "top")->limit(3)->toArray();
|
|
24
|
+ $bottom = Classify::where("location", "bottom")->first();
|
|
25
|
+
|
|
26
|
+ $tops = array_map(function ($t) {
|
|
27
|
+ return [
|
|
28
|
+ "id" => $t["id"],
|
|
29
|
+ "server" => $t["server"],
|
|
30
|
+ "content" => $t["content"],
|
|
31
|
+ "photo" => $t["photo"],
|
|
32
|
+ "location" => $t["location"]
|
|
33
|
+ ];
|
|
34
|
+ }, $top);
|
|
35
|
+
|
|
36
|
+ return Response()->json([
|
|
37
|
+ "top" => $tops,
|
|
38
|
+ "introduce" => "服务介绍",
|
|
39
|
+ "bottom" => [
|
|
40
|
+ "id" => $bottom["id"],
|
|
41
|
+ "server" => $bottom["server"],
|
|
42
|
+ "content" => $bottom["content"],
|
|
43
|
+ "photo" => $bottom["photo"],
|
|
44
|
+ "location" => $bottom["location"]
|
|
45
|
+ ]
|
|
46
|
+ ]);
|
|
47
|
+ }
|
|
48
|
+
|
16
|
49
|
|
17
|
50
|
/**
|
18
|
51
|
* 获取某个记录
|
|
@@ -205,7 +238,7 @@ class ClassifyController extends Controller
|
205
|
238
|
"pid" => $record->pid,
|
206
|
239
|
"name" => $record->name,
|
207
|
240
|
"info" => $record->info,
|
208
|
|
- "content" => $record->content,
|
|
241
|
+ "summary" => $record->summary,
|
209
|
242
|
"api" => $data["api"],
|
210
|
243
|
"fields" => $data["fields"]
|
211
|
244
|
]
|