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