Get topic start and last post API calls.

このコミットが含まれているのは:
テクニカル諏訪子 2018-02-19 21:08:56 +09:00
コミット 1312bc0088
2個のファイルの変更19行の追加3行の削除

ファイルの表示

@ -96,7 +96,7 @@ class BoardController extends Controller {
public function getTopics($for, $from, $to) { // /api/rpc/board/topic/gettopics/for/from/to
return DB::table('for_threads')
->select('*')
->where('for_id', $id)
->where('for_id', $for)
->offset($from)
->limit($to)
->orderBy('last_date', 'desc')
@ -123,6 +123,20 @@ class BoardController extends Controller {
->get();
}
public function getTopicStart($top_id) { // /api/rpc/board/post/gettopicstart/top_id
return DB::table('for_posts')
->select('MIN(user_id)', 'post_date')
->where('top_id', $top_id)
->get();
}
public function getLastPost($top_id) { // /api/rpc/board/post/getlastpost/top_id
return DB::table('for_posts')
->select('MAX(user_id)', 'post_date')
->where('top_id', $top_id)
->get();
}
public function countUnpinnedTopicsInForum($for_id) { // /api/rpc/board/topic/countunpinnedtopicsinforum/for_id
return DB::table('for_threads')
->where('for_id', $for_id)

ファイルの表示

@ -40,8 +40,10 @@ Route::get('/api/rpc/board/post/getforumidfrompost/{id}', 'BoardController@getFo
Route::get('/api/rpc/board/post/gettopicidfrompost/{id}', 'BoardController@getTopicIdFromPost');
Route::get('/api/rpc/board/post/getcurrentpostcount/{user_id}', 'BoardController@getCurrentPostCount');
Route::get('/api/rpc/board/post/getnextpostcount/{user_id}', 'BoardController@getNextPostCount');
Route::get('/api/rpc/board/post/getuserposts/{top}/{from}/{to}', 'BoardController@getuserPosts');
Route::get('/api/rpc/board/post/getuserpost/{id}', 'BoardController@getuserPost');
Route::get('/api/rpc/board/post/getuserposts/{top}/{from}/{to}', 'BoardController@getUserPosts');
Route::get('/api/rpc/board/post/getuserpost/{id}', 'BoardController@getUserPost');
Route::get('/api/rpc/board/post/gettopicstart/{top_id}', 'BoardController@getTopicStart');
Route::get('/api/rpc/board/post/getlastpost/{top_id}', 'BoardController@getLastPost');
Route::post('/api/rpc/board/post/addpost', 'BoardController@addPost');
Route::post('/api/rpc/board/post/editpost', 'BoardController@editPost');