このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
076server/app/Http/Controllers/FileController.php

52 行
1.6 KiB
PHP
Raw 通常表示 履歴

2018-01-24 01:36:47 +09:00
<?php
namespace App\Http\Controllers;
2018-01-24 04:44:45 +09:00
use Illuminate\Support\Facades\DB;
2018-01-24 01:36:47 +09:00
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class FileController extends Controller {
2018-01-24 04:44:45 +09:00
public function getAllFiles() { // /api/rpc/file/getallfiles
2018-01-24 13:39:01 +09:00
return DB::table('str_file')->select('*')->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getAllApprovedFiles() { // /api/rpc/file/getallapprovedfiles
2018-01-24 13:39:01 +09:00
return DB::table('str_file')->select('*')->where('isApproved', 1)->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getAllBrokenFiles() { // /api/rpc/file/getallbrokenfiles
2018-01-24 13:39:01 +09:00
return DB::table('str_file')->select('*')->where('isBroken', 1)->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getAllPendingFiles() { // /api/rpc/file/getallpendingfiles
2018-01-24 13:39:01 +09:00
return DB::table('str_file')->select('*')->where('isApproved', 0)->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getNewFiles() { // /api/rpc/file/getnewfiles
2018-01-24 13:39:01 +09:00
return DB::table('str_file')
->select('id', 'title', 'submit_date')
->where('isApproved', 1)
->orderBy('submit_date', 'desc')
->limit(5)
->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getHotFiles() { // /api/rpc/file/gethotfiles
2018-01-24 13:39:01 +09:00
return DB::table('str_file')
->select('id', 'title', 'downloads')
->where('isApproved', 1)
->orderBy('downloads', 'desc')
->limit(5)
->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getFile($id) { // /api/rpc/file/getfile/id
2018-01-24 13:39:01 +09:00
return DB::table('str_file')->select('*')->where('id', $id)->get();
2018-01-24 01:36:47 +09:00
}
2018-01-24 04:44:45 +09:00
public function getFilesInCategory($cat_id) { // /api/rpc/file/getfilesincategory/cat_id
return DB::table('str_file')->select('*')->where('cat_id', $cat_id)->get();
2018-01-24 01:36:47 +09:00
}
}