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

67 行
2.0 KiB
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class OwnerController extends Controller {
public function countOwnersOfFile($file_id) { // /api/rpc/user/owner/countownersoffile/id
return DB::table('str_owners')
->where('file_id', $file_id)
->count();
}
public function getOwnersOfFile($file_id) { // /api/rpc/user/owner/getownersoffile/id
return DB::table('str_owners')
->join('str_file', 'str_owners.file_id', '=', 'str_file.id')
->join('for_users', 'str_owners.user_id', '=', 'for_users.id')
->where('file_id', $file_id)
->get(array(
"user_id",
"title",
"version",
"views",
"downloads",
"submit_date",
"last_date",
"username",
"avatar",
"perm_id",
"gender",
"display_name",
"name_colour",
));
}
public function countFilesOfOwner($user_id) { // /api/rpc/user/owner/countfilesofowner/id
return DB::table('str_owners')
->where('user_id', $user_id)
->count();
}
public function getFilesOfOwner($user_id) { // /api/rpc/user/owner/getfilesofowner/id
return DB::table('str_owners')
->join('str_file', 'str_owners.file_id', '=', 'str_file.id')
->join('for_users', 'str_owners.user_id', '=', 'for_users.id')
->where('user_id', $user_id)
->get(array(
"user_id",
"title",
"version",
"views",
"downloads",
"submit_date",
"last_date",
"username",
"avatar",
"perm_id",
"gender",
"display_name",
"name_colour",
));
}
}