From af5878a98f7dc8a725adcb6be7ada6035a428091 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 2 Sep 2020 20:41:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E7=82=B9=E6=B8=B8=E6=88=8F=E6=9C=89?= =?UTF-8?q?=E6=B5=81=E6=B0=B4=E7=9A=84=E5=B0=B1=E7=BB=99=E4=BA=88=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AjaxController.class.php | 18 +++++++++++++++--- .../viewSpecialComplement.html | 5 ++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index ea80320e6..459fcb2c6 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -567,14 +567,26 @@ class AjaxController extends ThinkController{ */ public function getPromoteGameList() { - $game_ids = I('game_ids'); + $company_id = $_REQUEST['company_id']; + + $spendData = M("spend use index(user_id)","tab_") + ->field("game_id") + ->join("left join tab_promote on tab_spend.promote_id=tab_promote.id") + ->where([ + 'company_id'=>$company_id, + 'pay_status'=>1, + 'pay_way'=>['egt',0] + ]) + ->group("game_id") + ->select(); - if ($game_ids) { - $map['relation_game_id'] = ['in',$game_ids]; + if ($spendData) { + $map['id'] = ['in',array_column($spendData,"game_id")]; } else { $this->ajaxReturn([]); } + $data = M("game","tab_") ->field("relation_game_id,relation_game_name") ->where($map) diff --git a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html index 78e728319..624cab528 100644 --- a/Application/Admin/View/CompanyStatement/viewSpecialComplement.html +++ b/Application/Admin/View/CompanyStatement/viewSpecialComplement.html @@ -631,9 +631,11 @@ }); var game_id = "{$_GET['game_id']??0}"; $("#company_id").on("change",function(){ + layer.load(2); var data = $(this).find("option:selected").data().value; + var company_id = $(this).find("option:selected").val(); - var url = "{:U('Ajax/getPromoteGameList')}"+"&game_ids="+data; + var url = "{:U('Ajax/getPromoteGameList')}"+"&game_ids="+data+"&company_id="+company_id; $.get(url,function(data){ var game = data; var gamestr = ''; @@ -646,6 +648,7 @@ } $("#relation_game_id").html(gamestr); $("#relation_game_id").select2(); + layer.closeAll("loading"); }) });