|
|
@@ -36,7 +36,12 @@ class GameLogic extends BaseLogic
|
|
|
*/
|
|
|
public function getIndex($where)
|
|
|
{
|
|
|
+ $auth_game_list = request()->header('auth_game_list');
|
|
|
$query = $this->search($where);
|
|
|
+ if(!empty($auth_game_list)) {
|
|
|
+ $authGameList = explode(',', $auth_game_list);
|
|
|
+ $query->where('id', 'in', $authGameList);
|
|
|
+ }
|
|
|
$query->order('sort', 'desc');
|
|
|
|
|
|
$data = $this->getList($query);
|
|
|
@@ -52,24 +57,32 @@ class GameLogic extends BaseLogic
|
|
|
* 获取游戏options列表
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getGameOptions()
|
|
|
+ public function getGameOptions($where)
|
|
|
{
|
|
|
- $list = $this->model->field('id,name')->where('status', 1)->order('sort', 'desc')->select()->toArray();
|
|
|
- $list = array_map(function ($item) {
|
|
|
- return [
|
|
|
- 'label' => $item['name'],
|
|
|
- 'value' => $item['id']
|
|
|
- ];
|
|
|
- }, $list);
|
|
|
+ $auth_game_list = request()->header('auth_game_list');
|
|
|
+ $query = $this->field('id as value,name as label');
|
|
|
+ if(!empty($auth_game_list)) {
|
|
|
+ $authGameList = explode(',', $auth_game_list);
|
|
|
+ $query->where('id', 'in', $authGameList);
|
|
|
+ }
|
|
|
+ $list = $query->select()->toArray();
|
|
|
return $list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取所有的游戏数据
|
|
|
*/
|
|
|
- public function getAllGameData()
|
|
|
+ public function getAllGameData($where)
|
|
|
{
|
|
|
- $game_list = $this->model->where('status', 1)->order('sort', 'desc')->select()->toArray();
|
|
|
+ $auth_game_list = request()->header('auth_game_list');
|
|
|
+ $query = $this->search($where);
|
|
|
+ if(!empty($auth_game_list)) {
|
|
|
+ $authGameList = explode(',', $auth_game_list);
|
|
|
+ $query->where('id', 'in', $authGameList);
|
|
|
+ }
|
|
|
+ $query->where('status', 1);
|
|
|
+ $query->order('sort', 'desc');
|
|
|
+ $game_list = $this->getList($query);
|
|
|
|
|
|
$mainGameMap = $this->gameMainLogic->getMainGameMap();
|
|
|
|
|
|
@@ -89,10 +102,17 @@ class GameLogic extends BaseLogic
|
|
|
/**
|
|
|
* 根据权限获取游戏列表
|
|
|
*/
|
|
|
- public function getGameListByPermission()
|
|
|
+ public function getGameListByPermission($where)
|
|
|
{
|
|
|
- $game_list = $this->getAllGameData();
|
|
|
- return $game_list;
|
|
|
+ $auth_game_list = request()->header('auth_game_list');
|
|
|
+ $query = $this->search($where);
|
|
|
+ if(!empty($auth_game_list)) {
|
|
|
+ $authGameList = explode(',', $auth_game_list);
|
|
|
+ $query->where('id', 'in', $authGameList);
|
|
|
+ }
|
|
|
+ $query->where('status', 1);
|
|
|
+ $query->order('sort', 'desc');
|
|
|
+ return $query->select()->toArray();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -136,5 +156,4 @@ class GameLogic extends BaseLogic
|
|
|
$this->systemDeptLogic->setGameListByDeptId($dept_id, $game_list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|