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"); }) });