|
|
@ -142,7 +142,9 @@ class FinancePromoteController extends AdminController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$promotes = index_by_column('id', $promotes);
|
|
|
|
$promotes = index_by_column('id', $promotes);
|
|
|
|
$adminUsernames = getAdminUsernameList(array_column($promotes, 'admin_id'));
|
|
|
|
$adminIds = array_column($promotes, 'admin_id');
|
|
|
|
|
|
|
|
$adminUsernames = getAdminUsernameList($adminIds);
|
|
|
|
|
|
|
|
$adminDepartments = getAdminDepartmentList($adminIds);
|
|
|
|
foreach($senddata as $k=>$v){
|
|
|
|
foreach($senddata as $k=>$v){
|
|
|
|
$promote = $promotes[$v['p_id']] ?? null;
|
|
|
|
$promote = $promotes[$v['p_id']] ?? null;
|
|
|
|
$v['company_belong'] = $v['company_belong'] ?:0;
|
|
|
|
$v['company_belong'] = $v['company_belong'] ?:0;
|
|
|
@ -156,6 +158,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
$v['promote_account'] = get_promote_name($v['p_id']);
|
|
|
|
$v['promote_account'] = get_promote_name($v['p_id']);
|
|
|
|
($v['promote_account']=='官方渠道')?($v['promote_account']=C('OFFICIEL_CHANNEL')):'';
|
|
|
|
($v['promote_account']=='官方渠道')?($v['promote_account']=C('OFFICIEL_CHANNEL')):'';
|
|
|
|
$v['admin_username'] = $adminUsernames[$promote['admin_id']] ?? '无';
|
|
|
|
$v['admin_username'] = $adminUsernames[$promote['admin_id']] ?? '无';
|
|
|
|
|
|
|
|
$v['admin_department'] = $adminDepartments[$promote['admin_id']] ?? '无';
|
|
|
|
$v['develop_type_text'] = getCompanyDevelopTypeText($v['develop_type']);
|
|
|
|
$v['develop_type_text'] = getCompanyDevelopTypeText($v['develop_type']);
|
|
|
|
$v['inside_cash_count'] = number_format($v['inside_cash_count'],2,'.','');
|
|
|
|
$v['inside_cash_count'] = number_format($v['inside_cash_count'],2,'.','');
|
|
|
|
$v['allcount'] = number_format($v['cash_count']-0+$v['balance_coin_count']+$v['bind_coin_count'],2,'.','');
|
|
|
|
$v['allcount'] = number_format($v['cash_count']-0+$v['balance_coin_count']+$v['bind_coin_count'],2,'.','');
|
|
|
@ -179,6 +182,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
"company_name"=>"推广公司",
|
|
|
|
"company_name"=>"推广公司",
|
|
|
|
"promote_account"=>"会长渠道",
|
|
|
|
"promote_account"=>"会长渠道",
|
|
|
|
"admin_username"=>"所属市场专员",
|
|
|
|
"admin_username"=>"所属市场专员",
|
|
|
|
|
|
|
|
"admin_department"=>"所属市场部",
|
|
|
|
"company_belong"=>"团体类型",
|
|
|
|
"company_belong"=>"团体类型",
|
|
|
|
"develop_type_text"=>"开发类型",
|
|
|
|
"develop_type_text"=>"开发类型",
|
|
|
|
"cash_count"=>"游戏现金金额",
|
|
|
|
"cash_count"=>"游戏现金金额",
|
|
|
@ -219,6 +223,9 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
|
|
|
|
|
|
|
$this->checkListOrCountAuthRestMap($map,[]);
|
|
|
|
$this->checkListOrCountAuthRestMap($map,[]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$departments = M('department', 'sys_')->select();
|
|
|
|
|
|
|
|
$this->assign('departments', $departments);
|
|
|
|
|
|
|
|
|
|
|
|
//外团占比
|
|
|
|
//外团占比
|
|
|
|
$this->assign('outBelong',number_format($outBelong/$count['all_count']*100,2,'.',''));
|
|
|
|
$this->assign('outBelong',number_format($outBelong/$count['all_count']*100,2,'.',''));
|
|
|
|
//内团占比
|
|
|
|
//内团占比
|
|
|
@ -264,21 +271,22 @@ class FinancePromoteController extends AdminController
|
|
|
|
$map['company.develop_type'] = ['in',I('develop_type')];
|
|
|
|
$map['company.develop_type'] = ['in',I('develop_type')];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$adminId = 0;
|
|
|
|
$adminIds = null;
|
|
|
|
// $havingPids = [];
|
|
|
|
// $havingPids = [];
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
$adminIds = [$userAuth['uid']];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
$adminIds = [I('admin_id')];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* if ($adminId > 0) {
|
|
|
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
if (is_null($adminIds) && isset($_REQUEST['department_id'])) {
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
$admins = getMarketAdmin($_REQUEST['department_id']);
|
|
|
|
} */
|
|
|
|
$adminIds = count($admins) ? array_column($admins, 'uid') : [-1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($type == "spend"){
|
|
|
|
if($type == "spend"){
|
|
|
|
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
|
|
|
|
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
|
|
|
@ -290,8 +298,8 @@ class FinancePromoteController extends AdminController
|
|
|
|
if ($isMarketLeader) {
|
|
|
|
if ($isMarketLeader) {
|
|
|
|
$map['s.market_admin_id'] = ['gt', 0];
|
|
|
|
$map['s.market_admin_id'] = ['gt', 0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($adminId > 0) {
|
|
|
|
if (is_array($adminIds)) {
|
|
|
|
$map['s.market_admin_id'] = $adminId;
|
|
|
|
$map['s.market_admin_id'] = ['in', $adminIds];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$map['s.pay_status']=1;
|
|
|
|
$map['s.pay_status']=1;
|
|
|
|
$map['s.is_check']=2;
|
|
|
|
$map['s.is_check']=2;
|
|
|
@ -349,21 +357,22 @@ class FinancePromoteController extends AdminController
|
|
|
|
$map['company.develop_type'] = ['in',I('develop_type')];
|
|
|
|
$map['company.develop_type'] = ['in',I('develop_type')];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$adminId = 0;
|
|
|
|
$adminIds = null;
|
|
|
|
// $havingPids = [];
|
|
|
|
// $havingPids = [];
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
$adminIds = [$userAuth['uid']];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
$adminIds = [I('admin_id')];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* if ($adminId > 0) {
|
|
|
|
|
|
|
|
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
if (is_null($adminIds) && isset($_REQUEST['department_id'])) {
|
|
|
|
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
$admins = getMarketAdmin($_REQUEST['department_id']);
|
|
|
|
} */
|
|
|
|
$adminIds = count($admins) ? array_column($admins, 'uid') : [-1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($type == "spend"){
|
|
|
|
if($type == "spend"){
|
|
|
|
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
|
|
|
|
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
|
|
|
@ -375,8 +384,8 @@ class FinancePromoteController extends AdminController
|
|
|
|
if ($isMarketLeader) {
|
|
|
|
if ($isMarketLeader) {
|
|
|
|
$map['s.market_admin_id'] = ['gt', 0];
|
|
|
|
$map['s.market_admin_id'] = ['gt', 0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($adminId > 0) {
|
|
|
|
if (is_array($adminIds)) {
|
|
|
|
$map['s.market_admin_id'] = $adminId;
|
|
|
|
$map['s.market_admin_id'] = ['in', $adminIds];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$map['s.pay_status']=1;
|
|
|
|
$map['s.pay_status']=1;
|
|
|
|
// $map['s.is_check']=1;
|
|
|
|
// $map['s.is_check']=1;
|
|
|
@ -400,20 +409,9 @@ class FinancePromoteController extends AdminController
|
|
|
|
if($istimeselect){
|
|
|
|
if($istimeselect){
|
|
|
|
$map['s.create_time']=$istimeselect;
|
|
|
|
$map['s.create_time']=$istimeselect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$adminId = 0;
|
|
|
|
if (is_array($adminIds)) {
|
|
|
|
// $havingPids = [];
|
|
|
|
$map['promote.admin_id'] = ['in', $adminIds];
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
// $havingPids = M('promote', 'tab_')->where(['admin_id' => ['in', $adminIds]])->getField('id', true);
|
|
|
|
if ($isMarketAdmin) {
|
|
|
|
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (!empty(I('admin_id'))) {
|
|
|
|
|
|
|
|
$adminId = I('admin_id');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($adminId > 0) {
|
|
|
|
|
|
|
|
$map['promote.admin_id'] = $adminId;
|
|
|
|
|
|
|
|
// $havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
|
|
|
|
|
|
|
|
// $havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
// $havingPids = count($havingPids) > 0 ? $havingPids : [0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$map['s.status']=1;
|
|
|
|
$map['s.status']=1;
|
|
|
|