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

108 行
3.2 KiB
PHP
Raw 通常表示 履歴

2018-02-06 06:08:19 +09:00
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class BoardController extends Controller {
public function getCategories() { // /api/rpc/board/category/getcategories
return DB::table('for_category')
->select('*')
->orderBy('order', 'asc')
->get();
}
public function getCategory($id) { // /api/rpc/board/category/getcategory/id
return DB::table('for_category')
->select('*')
->where('id', $id)
->get();
}
2018-02-06 17:24:16 +09:00
public function getCategoryName($id) { // /api/rpc/board/category/getcategoryname/id
return DB::table('for_category')
->select('title')
->where('id', $id)
->get();
}
public function getForums() { // /api/rpc/board/forum/getforums
2018-02-06 06:08:19 +09:00
return DB::table('for_forums')
->select('*')
->orderBy('order', 'asc')
->get();
}
2018-02-06 17:24:16 +09:00
public function getForum($id) { // /api/rpc/board/forum/getforum/id
return DB::table('for_forums')
->select('*')
->where('id', $id)
->orderBy('order', 'asc')
->get();
}
public function getForumName($id) { // /api/rpc/board/forum/getforumname/id
return DB::table('for_forums')
->select('cat_id', 'title')
->where('id', $id)
->orderBy('order', 'asc')
->get();
}
2018-02-06 16:12:00 +09:00
public function getForumsInCategory($cat_id) { // /api/rpc/board/forum/getforumsincategory/cat_id
2018-02-06 06:08:19 +09:00
return DB::table('for_forums')
->select('*')
->where('cat_id', $cat_id)
->get();
}
2018-02-06 17:24:16 +09:00
public function getTopics($for, $from, $to) { // /api/rpc/board/topic/gettopics/for/from/to
return DB::table('for_threads')
->select('*')
->where('for_id', $id)
->offset($from)
->limit($to)
->orderBy('last_date', 'desc')
->get();
}
public function getTopicsUnpinned($for_id, $from, $to) { // /api/rpc/board/topic/gettopicsunpinned/for_id
return DB::table('for_threads')
->select('*')
->where('for_id', $for_id)
->where('sticky', 0)
->offset($from)
->limit($to)
->orderBy('last_date', 'desc')
->get();
}
public function getTopicsPinned($for_id) { // /api/rpc/board/topic/gettopicspinned/for_id
return DB::table('for_threads')
->select('*')
->where('for_id', $for_id)
->where('sticky', 1)
->orderBy('last_date', 'desc')
->get();
}
public function countUnpinnedTopicsInForum($for_id) { // /api/rpc/board/topic/countunpinnedtopicsinforum/for_id
return DB::table('for_threads')
->where('for_id', $for_id)
->where('sticky', 0)
->count();
}
public function getTopic($id, $from, $to) { // /api/rpc/board/forum/gettopics/id/from/to
return DB::table('for_threads')
->select('*')
->where('id', $id)
->offset($from)
->limit($to)
->orderBy('last_date', 'desc')
->get();
}
2018-02-06 06:08:19 +09:00
}