|
@@ -19,6 +19,7 @@ class ServerInfoController extends Controller
|
19
|
19
|
$server = $request->input('server');
|
20
|
20
|
$content = $request->input('content');;
|
21
|
21
|
$photo = $request->input('photo');
|
|
22
|
+ $location = $request->input('location');
|
22
|
23
|
if ($id) {
|
23
|
24
|
$serverInfo = ServerInfo::find($id);
|
24
|
25
|
} else {
|
|
@@ -28,6 +29,7 @@ class ServerInfoController extends Controller
|
28
|
29
|
$serverInfo->server = $server;
|
29
|
30
|
$serverInfo->content = $content;
|
30
|
31
|
$serverInfo->photo = $photo;
|
|
32
|
+ $serverInfo->location = $location;
|
31
|
33
|
$serverInfo->save();
|
32
|
34
|
return Response()->json([
|
33
|
35
|
"status" => 0,
|
|
@@ -48,6 +50,12 @@ class ServerInfoController extends Controller
|
48
|
50
|
*/
|
49
|
51
|
public function list(Request $request)
|
50
|
52
|
{
|
51
|
|
- return ServerInfo::paginate(20);
|
|
53
|
+ $top = ServerInfo::where("location", "top");
|
|
54
|
+ $bottom = ServerInfo::where("location", "bottom");
|
|
55
|
+ return Response()->json([
|
|
56
|
+ "top" => $top,
|
|
57
|
+ "introduce" => "服务介绍",
|
|
58
|
+ "bottom" => $bottom
|
|
59
|
+ ]);
|
52
|
60
|
}
|
53
|
61
|
}
|