|
|
|
@ -80,10 +80,9 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
$nwtflag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(isset($_REQUEST['develop_type'])){
|
|
|
|
|
if($_REQUEST['develop_type']!=0){
|
|
|
|
|
$nwtflag = false;
|
|
|
|
|
}
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if(I('admin_id', 0) != 0 || $isMarketAdmin){
|
|
|
|
|
$nwtflag = false;
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
|
if($_REQUEST['promote_id'] == 0){
|
|
|
|
@ -236,11 +235,22 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
$map['company.develop_type'] = I('develop_type');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$adminId = 0;
|
|
|
|
|
$havingPids = [];
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
} else {
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($type == "spend"){
|
|
|
|
|
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
|
|
|
|
|
$map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
|
|
|
|
@ -269,9 +279,19 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
if($istimeselect){
|
|
|
|
|
$map['s.create_time']=$istimeselect;
|
|
|
|
|
}
|
|
|
|
|
$adminId = 0;
|
|
|
|
|
$havingPids = [];
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
} else {
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
|
}
|
|
|
|
|
$map['s.status']=1;
|
|
|
|
@ -455,9 +475,20 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
->join("tab_promote_company company ON promote.company_id = company.id", "left")
|
|
|
|
|
->group('promote_id');
|
|
|
|
|
|
|
|
|
|
$adminId = 0;
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
} else {
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$havingPids = [];
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$topIds = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
$topIds = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
|
$havingPids = getPromoteIdsByTopIds($topIds);
|
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
|
$query->having('promote_id in (' . implode(',', $havingPids) . ')');
|
|
|
|
@ -477,10 +508,20 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
->join("tab_promote promote ON s.promote_id = promote.id","left")
|
|
|
|
|
->join("tab_promote_company company ON promote.company_id = company.id", "left")
|
|
|
|
|
->group('promote_id');
|
|
|
|
|
$adminId = 0;
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
} else {
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$havingPids = [];
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$topIds = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
$topIds = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
|
$havingPids = getPromoteIdsByTopIds($topIds);
|
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
|
$query->having('promote_id in (' . implode(',', $havingPids) . ')');
|
|
|
|
@ -628,8 +669,20 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($_REQUEST['admin_id'])) {
|
|
|
|
|
$map['market_admin_id'] = $_REQUEST['admin_id'];
|
|
|
|
|
$adminId = 0;
|
|
|
|
|
$havingPids = [];
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
} else {
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
$map['market_admin_id'] = $adminId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* if (!empty(I('develop_type'))) {
|
|
|
|
@ -717,6 +770,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
"game_name"=>"游戏名称",
|
|
|
|
|
"sdk_version"=>"设备名称",
|
|
|
|
|
"promote_account"=>"所属推广员",
|
|
|
|
|
"market_admin_username"=>"所属市场专员",
|
|
|
|
|
"spend_ip"=>"充值ip",
|
|
|
|
|
"server_name"=>"游戏区服",
|
|
|
|
|
"game_player_name"=>"角色名称",
|
|
|
|
@ -770,9 +824,19 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
if ($row != 0) {
|
|
|
|
|
$query = $query->page($page,$row);
|
|
|
|
|
}
|
|
|
|
|
$adminId = 0;
|
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
} else {
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$havingPids = [];
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
|
$query->having('p_id in (' . implode(',', $havingPids) . ')');
|
|
|
|
|
}
|
|
|
|
|