ith5 6 месяцев назад
Родитель
Сommit
cbb2a7c7e7

+ 23 - 2
app/v1/controller/CommonController.php

@@ -74,7 +74,7 @@ class CommonController extends BaseController
     }
 
     /**
-     * 获取树形游戏options列表(有权限)
+     * 获取游戏options列表(有权限)
      * @return Response
      */
     public function getTreeGameOptions(Request $request): Response
@@ -83,7 +83,28 @@ class CommonController extends BaseController
         $data = $this->gameLogic->getGameListByPermission($where);
         return $this->success($data);
     }
-    
+
+    /**
+     * 获取树形游戏options列表(无权限)
+     * @return Response
+     */
+    public function getGameListTreeNoAuth(Request $request): Response
+    {
+        $where = $request->get();
+        $data = $this->gameLogic->getGameListTreeNoAuth($where);
+        return $this->success($data);
+    }
+
+    /**
+     * 获取树形游戏options列表(有权限)
+     * @return Response
+     */
+    public function getGameListTree(Request $request): Response
+    {
+        $where = $request->get();
+        $data = $this->gameLogic->getGameListTree($where);
+        return $this->success($data);
+    }
 
 
     /**

+ 2 - 0
app/v1/controller/advert/AgentListController.php

@@ -40,6 +40,8 @@ class AgentListController extends BaseController
         $where = $request->more([
             ['auth_id', ''],
             ['name', ''],
+            ['id', ''],
+            ['media_id', ''],
         ]);
         $query = $this->logic->search($where);
         $data = $this->logic->getList($query);

+ 9 - 9
app/v1/controller/advert/AgentSiteController.php

@@ -48,18 +48,18 @@ class AgentSiteController extends BaseController
             ['agent_id', ''],
             ['auth_id', ''],
             ['name', ''],
+            ['id', ''],
+            ['agent_name', ''],
         ]);
+
+        if(!empty($where['agent_name'])){
+            $where['agent_id'] = $this->agentListLogic->where('name', 'like', '%'.$where['agent_name'].'%')->value('id');
+            unset($where['agent_name']);
+        }
+
         $query = $this->logic->search($where);
         $data = $this->logic->getList($query);
-        $userListData = array_column($this->systemUserLogic->field('id,username')->select()->toArray(),'username','id');
-        $agentListData = array_column($this->agentListLogic->field('id,name')->select()->toArray(),'name','id');
-        $mediaListData = array_column($this->mediaListLogic->field('id,name')->select()->toArray(),'name','id');
-        $data['data'] = array_map(function ($item) use ($userListData, $agentListData, $mediaListData) {
-            $item['auth_name'] = $userListData[$item['auth_id']] ?? '';
-            $item['agent_name'] = $agentListData[$item['agent_id']] ?? '';
-            $item['media_name'] = $mediaListData[$item['media_id']] ?? '';
-            return $item;
-        }, $data['data']);
+        $data['data'] = $this->logic->trandformListColumn($data['data'],['agent','media','auth']);
         return $this->success($data);
     }
 

+ 2 - 0
app/v1/controller/center/IosPayWayController.php

@@ -35,9 +35,11 @@ class IosPayWayController extends BaseController
     public function index(Request $request): Response
     {
         $where = $request->more([
+            ['game_id', ''],
         ]);
         $query = $this->logic->search($where);
         $data = $this->logic->getList($query);
+        $data['data'] = $this->logic->trandformListColumn($data['data'], ['game']);
         return $this->success($data);
     }
 

+ 4 - 2
app/v1/controller/gameLog/GamePackLogController.php

@@ -35,11 +35,13 @@ class GamePackLogController extends BaseController
     public function index(Request $request): Response
     {
         $where = $request->more([
-            ['game_name', ''],
+            ['game_id', ''],
+            ['agent_id', ''],
+            ['site_id', ''],
         ]);
         $query = $this->logic->search($where);
         $data = $this->logic->getList($query);
-        $data['data'] = $this->logic->trandformListColumn($data['data'],['agent','site']);
+        $data['data'] = $this->logic->trandformListColumn($data['data'],['agent','site','game']);
         return $this->success($data);
     }
 

+ 54 - 2
app/v1/logic/center/GameLogic.php

@@ -104,7 +104,7 @@ class GameLogic extends BaseLogic
             $groupedGames[$mainId]['name'] = $mainGameMap[$mainId] ?? $mainId;
             $groupedGames[$mainId]['children'][] = [
                 'id' => $game['id'],
-                'name' => '【'.$game['id'].'】'.$game['name']
+                'name' => '['.$game['id'].']'.$game['name']
             ];
          }
         return array_values($groupedGames);
@@ -126,6 +126,58 @@ class GameLogic extends BaseLogic
         return $query->select()->toArray();
     }
 
+    /**
+     * 根据权限获取游戏列表树形(无权限)
+     */
+    public function getGameListTreeNoAuth($where)
+    {
+ 
+        $game_list = $this->model->where('status', 1)->order('sort', 'desc')->select()->toArray();
+        $mainGameMap = $this->gameMainLogic->getMainGameMap();
+        $groupedGames = [];
+        foreach ($game_list as $game) {
+            $mainId = $game['main_id'];
+            $groupedGames[$mainId]['id'] = 'main_id_'.$mainId;
+            $groupedGames[$mainId]['disabled'] = ($where['single'] ?? false);
+            $groupedGames[$mainId]['name'] = $mainGameMap[$mainId] ?? $mainId;
+            $groupedGames[$mainId]['children'][] = [
+                'id' => $game['id'],
+                'name' => '['.$game['id'].']'.$game['name']
+            ];
+        }
+        return array_values($groupedGames);
+    }
+
+    /**
+     * 根据权限获取游戏列表树形(有权限)
+     */
+    public function getGameListTree($where)
+    {
+        $auth_game_list = request()->header('auth_game_list');
+        $query = $this->search();
+        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 = $query->select()->toArray();
+        $mainGameMap = $this->gameMainLogic->getMainGameMap();
+        $groupedGames = [];
+        foreach ($game_list as $game) {
+            $mainId = $game['main_id'];
+            $groupedGames[$mainId]['id'] = 'main_id_'.$mainId;
+            $groupedGames[$mainId]['disabled'] = ($where['single'] ?? false);
+            $groupedGames[$mainId]['name'] = $mainGameMap[$mainId] ?? $mainId;
+            $groupedGames[$mainId]['children'][] = [
+                'id' => $game['id'],
+                'name' => '['.$game['id'].']'.$game['name']
+            ];
+        }
+        return array_values($groupedGames);
+    }
+
+
     /**
      * 根据部门ID获取游戏列表
      * @param array $where
@@ -150,7 +202,7 @@ class GameLogic extends BaseLogic
             $groupedGames[$mainId]['name'] = $mainGameMap[$mainId] ?? $mainId;
             $groupedGames[$mainId]['children'][] = [
                 'id' => $game['id'],
-                'name' => '【'.$game['id'].'】'.$game['name']
+                'name' => '['.$game['id'].']'.$game['name']
             ];
          }
         return array_values($groupedGames);

BIN
plugin/saiadmin/public/export/分包标识数据20250704113640.xlsx


BIN
plugin/saiadmin/public/export/分包标识数据20250704113853.xlsx


BIN
plugin/saiadmin/public/export/广点通分包_标识数据_20250704114709.xlsx


BIN
plugin/saiadmin/public/export/广点通分包_标识数据_20250704143112.xlsx


BIN
plugin/saiadmin/public/export/快手分包_分包标识数据_20250704114152.xlsx