From d6e44d32dc15d2f839874437e47b1f39e9db9640 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 24 Mar 2020 11:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A8=E5=B9=BF=E5=91=98?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=B8=B8=E6=88=8F=E5=90=8D=E7=A7=B0=E5=8F=8A?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 21 +++++++++++++++++-- Application/Admin/View/Promote/lists.html | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index ef77192dc..50bcb86e1 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1123,15 +1123,15 @@ class PromoteController extends ThinkController { if (IS_AJAX) { //获取所有游戏 - $game_list = M('game', 'tab_')->field('id,game_name,short')->where(['game_status'=>1,'down_port'=>1])->select(); + $game_list = M('game', 'tab_')->field('relation_game_id id,relation_game_name game_name,short')->where(['game_status'=>1,'down_port'=>1])->group("relation_game_id")->select(); $data['data']['game_list'] = empty($game_list) ? '' : $game_list; //获取推广员信息 $promote_info = M('promote', 'tab_')->field('id,account,game_ids')->where(['id'=>I('id', 0, 'intval')])->find(); if (!empty($promote_info['game_ids'])) { + $this->changeGameidToRelationGameid($promote_info['game_ids']); $promote_info['game_ids'] = explode(',', $promote_info['game_ids']); } $data['data']['promote_info'] = empty($promote_info) ? '' : $promote_info; - $data['msg'] = '请求成功'; $data['code'] = 1; @@ -1139,6 +1139,14 @@ class PromoteController extends ThinkController exit; } } + //普通游戏id转唯一游戏id + protected function changeGameidToRelationGameid(&$ids) + { + $rid = M('game', 'tab_')->field('relation_game_id')->where(["id"=>["in",$ids]])->group("relation_game_id")->select(); + if($rid){ + $ids = implode(",",array_column($rid,'relation_game_id')); + } + } //更新推广员可推广游戏 @@ -1152,6 +1160,7 @@ class PromoteController extends ThinkController $game_ids = I('game_ids', ''); if (!empty($game_ids)) { $game_ids = implode(',', $game_ids); + $this->changeRelationGameidToGameid($game_ids); } else { $game_ids = 0; } @@ -1163,6 +1172,14 @@ class PromoteController extends ThinkController } } } + //唯一游戏id转普通游戏id + protected function changeRelationGameidToGameid(&$ids) + { + $rid = M('game', 'tab_')->field('id')->where(["relation_game_id"=>["in",$ids]])->select(); + if($rid){ + $ids = implode(",",array_column($rid,'id')); + } + } public function shortCutMenu($p = 1) { diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index 014df7416..9f973fa42 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -422,7 +422,7 @@ 全选 -