公会统计游戏统计新增多重搜索

master
chenzhi 5 years ago
parent fa3adf2e0b
commit 9e2eb46904

@ -45,7 +45,6 @@ class FinancePromoteController extends AdminController
$senddata[$v['p_id']] = $v;
}
// dump($cash);die();
//内冲
$inside = self::getJoinPromoteData([],$istimeselect,"promote_coin");
foreach($inside as $k=>$v){
@ -109,7 +108,6 @@ class FinancePromoteController extends AdminController
"bind_coin_count"=>0,
"inside_cash_count"=>0,
);
// dump($senddata);die();
foreach($senddata as $k=>$v){
if ($v['company_belong']==1) {
$v['company_belong']='外团';
@ -152,7 +150,6 @@ class FinancePromoteController extends AdminController
$outBelong = 0;
$insideBelong = 0;
// dump($data);die();
foreach ($data as $key => $value) {
if ($value['company_belong']=='外团') {
@ -174,7 +171,6 @@ class FinancePromoteController extends AdminController
$this->assign('all_count', $count);
$this->meta_title = '公会统计';
$this->display();
# code...
}
private function getJoinPromoteData($map,$istimeselect,$type="spend")
{
@ -413,7 +409,7 @@ class FinancePromoteController extends AdminController
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$row = $_REQUEST['row'] ?? 10;
$title = '';
$map = [];
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')) );
@ -429,6 +425,49 @@ class FinancePromoteController extends AdminController
} elseif (isset($_REQUEST['time_end'])) {
$map['s.pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399];
}
//公司判断
$pmap = false; //非特意推广员检索
$gfflg = true; //是否有官方
if (isset($_REQUEST['company_id'])) {
$pmap['company_id'] = $_REQUEST['company_id'];
//获取公司名称
if($pmap['company_id'] == 0){
$title .= "万盟天下科技-";
}else{
$gfflg = false;
$title .= (M('promote_company',"tab_")->field("company_name")->where("id = '{$pmap['company_id']}'")->find()['company_name'] . "-");
}
}
if (isset($_REQUEST['company_belong'])) {
$pmap['company_belong'] = $_REQUEST['company_belong'];
if($_REQUEST['company_belong'] == 0){
$title .= "内团-";
}else{
$gfflg = false;
$title .= "外团-";
}
}
if (isset($_REQUEST['promote_id'])) {
$pmap = false; //取消非特异推广员检索
$title .= (get_promote_name($_REQUEST['promote_id'])."-");
if ($_REQUEST['promote_id'] != 0){
$gfflg = false;
}
}
if($pmap){
$promoter_ids = D("Promote")->where($pmap)->field('id')->select();
if ($promoter_ids) {
if($gfflg){
$t_in = "0,".implode(',', array_column($promoter_ids, 'id'));
}else{
$t_in = implode(',', array_column($promoter_ids, 'id'));
}
$map['s.promote_id'] = ['in',$t_in];
}
}
//判断是否有推广员
$level = 1;
if ($_REQUEST['promote_id'] != '') {
@ -438,13 +477,17 @@ class FinancePromoteController extends AdminController
if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) {
$map['s.promote_id'] = $_REQUEST['promote_id'];
} else {
//判断收有公司
$promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select();
if ($promoter_ids) {
$map['s.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
}
}
}
$this->assign('promote_level', $level);
$title .= "游戏统计";
$this->assign('title', $title);
//游戏统计列表
$data =self::gameStatisticsData($map, $row, $p);

@ -72,10 +72,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">
<if condition="isset($_GET['promote_id'])">
[{:get_promote_name(I('promote_id'))}]
</if>
游戏统计
{$title}
</h3>
<p class="description_text">
<if condition="isset($_GET['promote_id'])">

Loading…
Cancel
Save