Added locale support in stores' game and category parts.
このコミットが含まれているのは:
コミット
46a95c1692
|
@ -19,16 +19,26 @@ class StoreController extends Controller {
|
|||
|
||||
// Game
|
||||
public function getGames() { // /api/rpc/store/game/getgames
|
||||
return DB::table('str_games')
|
||||
->select('*')
|
||||
->get();
|
||||
return DB::table('str_games_loc')
|
||||
->join('str_locale', 'str_locale.id', '=', 'str_games_loc.loc_id')
|
||||
->join('str_games', 'str_games.id', '=', 'str_games_loc.ref_id')
|
||||
->get(array(
|
||||
'str_games.id',
|
||||
'str_games.name',
|
||||
'str_games_loc.name as altname'
|
||||
));
|
||||
}
|
||||
|
||||
public function getGame($id) { // /api/rpc/store/game/getgame/id
|
||||
return DB::table('str_games')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
return DB::table('str_games_loc')
|
||||
->join('str_locale', 'str_locale.id', '=', 'str_games_loc.loc_id')
|
||||
->join('str_games', 'str_games.id', '=', 'str_games_loc.ref_id')
|
||||
->where('str_games.id', $id)
|
||||
->get(array(
|
||||
'str_games.id',
|
||||
'str_games.name',
|
||||
'str_games_loc.name as altname'
|
||||
));
|
||||
}
|
||||
|
||||
public function newGame(Request $request) { // /api/rpc/store/games/newgame
|
||||
|
@ -50,25 +60,42 @@ class StoreController extends Controller {
|
|||
|
||||
// Category
|
||||
public function getCategories() { // /api/rpc/store/category/getcategories
|
||||
return DB::table('str_category')
|
||||
->select('*')
|
||||
->get();
|
||||
return DB::table('str_category_loc')
|
||||
->join('str_locale', 'str_locale.id', '=', 'str_category_loc.loc_id')
|
||||
->join('str_category', 'str_category.id', '=', 'str_category_loc.ref_id')
|
||||
->get(array(
|
||||
'str_category.id',
|
||||
'str_category.name',
|
||||
'str_category_loc.name as altname',
|
||||
'str_category.game_id',
|
||||
'str_category.min_screenshots'
|
||||
));
|
||||
}
|
||||
|
||||
public function getCategory($id) { // /api/rpc/store/category/getcategory/id
|
||||
return DB::table('str_category')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
return DB::table('str_category_loc')
|
||||
->join('str_locale', 'str_locale.id', '=', 'str_category_loc.loc_id')
|
||||
->join('str_category', 'str_category.id', '=', 'str_category_loc.ref_id')
|
||||
->where('str_category.id', $id)
|
||||
->get(array(
|
||||
'str_category.id',
|
||||
'str_category.name',
|
||||
'str_category_loc.name as altname',
|
||||
'str_category.game_id',
|
||||
'str_category.min_screenshots'
|
||||
));
|
||||
}
|
||||
|
||||
public function getCategoriesOfGame($id) { // /api/rpc/store/category/getcategoriesofgame/id
|
||||
return DB::table('str_category')
|
||||
return DB::table('str_category_loc')
|
||||
->join('str_locale', 'str_locale.id', '=', 'str_category_loc.loc_id')
|
||||
->join('str_category', 'str_category.id', '=', 'str_category_loc.ref_id')
|
||||
->join('str_games', 'str_category.game_id', '=', 'str_games.id')
|
||||
->where('str_games.id', $id)
|
||||
->get(array(
|
||||
'str_category.id',
|
||||
'str_category.name'
|
||||
'str_category.name',
|
||||
'str_category_loc.name as altname'
|
||||
));
|
||||
}
|
||||
|
||||
|
|
新しいイシューから参照