优化公司游戏名游戏类型关系检索

master
chenzhi 5 years ago
parent b1e9127e9d
commit 9d89be4527

@ -560,6 +560,27 @@ function getGameByName($game_name=null, $sdk_version=null)
return $result;
}
}
//根据游戏公司,游戏名称,游戏类型
function getGameidByPartnerNameType($partner_id=null,$game_name=null, $sdk_version=null)
{
$map = [];
if($partner_id){
$map['partner_id'] = $partner_id;
}
if ($game_name) {
$map['relation_game_name'] = $game_name;
}
if ($sdk_version) {
$map['sdk_version'] = $sdk_version;
}
$result = D("Game")->field('id')->where($map)->select();
if(empty($result)) {
return [['id' => -1]];
}else
{
return $result;
}
}
function getTopPromote($promote_id)
{

@ -121,6 +121,7 @@ class FinancePromoteController extends AdminController
}
private function getJoinPromoteData($map,$istimeselect,$type="spend")
{
setPowerPromoteIds($map,"s.promote_id");
if ($_REQUEST['promote_id'] != '') {
if ($_REQUEST['promote_id'] == 0) {
$map['s.promote_id'] = 0;
@ -276,6 +277,7 @@ class FinancePromoteController extends AdminController
}
private function promoteUserData($map,$istimeselect,$type="spend")
{
setPowerPromoteIds($map,"s.promote_id");
if ($_REQUEST['promote_id'] != '') {
if ($_REQUEST['promote_id'] == 0) {
$map['s.promote_id'] = 0;
@ -436,14 +438,8 @@ class FinancePromoteController extends AdminController
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
if (!empty(I('partner_id'))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['game_id'] = ['in',$gameId];
}
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) {
$map["game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
@ -595,18 +591,21 @@ class FinancePromoteController extends AdminController
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
if (!empty(I('partner_id'))&&empty(I("game_id"))) {
$wherePartner = I('partner_id');
$gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
$gameId = implode(',',array_column($gameId,'id'));
$map['tab_spend.game_id'] = ['in',$gameId];
}
// if (!empty(I('partner_id'))&&empty(I("game_id"))) {
// $wherePartner = I('partner_id');
// $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select();
// $gameId = implode(',',array_column($gameId,'id'));
// $map['tab_spend.game_id'] = ['in',$gameId];
// }
if (!empty(I("game_id"))) {
$map['tab_spend.game_id'] = I("game_id");
}
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) {
$map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
// if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
// $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
// }
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];

@ -325,12 +325,27 @@
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
// $("#game_type").empty();
}
})
}
//设置设备类型
function gameTypeInit() {
// var game_type = "{:I('game_type')}";
var str = "<option value=''>请选择设备类型</option><option value='1'>安卓</option><option value='2'>苹果</option>";
$("#game_type").empty();
$("#game_type").append(str);
$("#game_type").select2();
}
var seleinit = 0;
$("#partner_id").change(function(){
get_game_list();
if(seleinit > 0){
gameTypeInit();
}
seleinit++;
});
$("#partner_id").change();

Loading…
Cancel
Save