41 行
1.1 KiB
PHP
41 行
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class CategoryController extends Controller {
|
|
public function getCategories() { // /api/rpc/category/getcategories
|
|
return DB::table('str_category')
|
|
->select('*')
|
|
->get();
|
|
}
|
|
|
|
public function getCategory($id) { // /api/rpc/category/getcategory/1
|
|
return DB::table('str_category')
|
|
->select('*')
|
|
->where('id', $id)
|
|
->get();
|
|
}
|
|
|
|
public function getCategoryParent($id) { // /api/rpc/category/getcategoryparent/1
|
|
return DB::table('str_category')
|
|
->select('parent_id')
|
|
->where('id', $id)
|
|
->get();
|
|
}
|
|
|
|
public function getCategoryMinScreenshots($id) { // /api/rpc/category/getcategoryminscrot/1
|
|
return DB::table('str_category')
|
|
->select('min_screenshots')
|
|
->where('id', $id)
|
|
->get();
|
|
}
|
|
|
|
public function category($cat_id) { // /category/cat_id
|
|
return view('category', compact('cat_id'));
|
|
}
|
|
}
|