diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index f5a44a199..497f5b7f1 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1041,6 +1041,8 @@ class QueryController extends ThinkController ->order("my_time Desc") ->select(false); + setPowerPromoteIds($map,'root_id'); + $count = M()->table('('.$data.') as a') ->field("my_time,pay_amount,game_id,game_names,promote_id,promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account") ->join("left join tab_promote on root_id = tab_promote.id") @@ -1051,7 +1053,7 @@ class QueryController extends ThinkController //关联表获取会长账号名 $data = M()->table('('.$data.') as a') - ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,ratio,last_turnover_ratio") + ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,ratio,turnover_ratio") ->join("left join tab_promote on root_id = tab_promote.id") ->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.game_id and tab_ratio.promote_id=root_id") ->page($page,$row) @@ -1072,7 +1074,19 @@ class QueryController extends ThinkController $data[$key]['downstream'] = $value['pay_amount'] * 0.1; } - $data[$key]['highquality'] = ($value['pay_amount']-$data[$key]['upstream']-$data[$key]['downstream']) * (1-0.0672); + $value['turnover_ratio'] = json_decode($value['turnover_ratio'],true); +// array_push($value['turnover_ratio'],['turnover'=>1006,'ratio'=>30]); +// dump(json_encode($value['turnover_ratio']));die(); + + if (is_array($value['turnover_ratio'])) { + foreach($value['turnover_ratio'] as $k =>$v) { + if($value['pay_amount']>$v['turnover']) { + $data[$key]['downstream'] = $value['pay_amount'] * ($v['ratio']*0.01); + } + } + } + + $data[$key]['highquality'] = number_format(($value['pay_amount']-$data[$key]['upstream']-$data[$key]['downstream']) * (1-0.0672),2,'.',''); $data[$key]['company_belong'] = $data[$key]['company_belong']?'外团':'内团'; $data[$key]['company_relation'] = $data[$key]['company_relation']?'只维护':'自主开发及维护'; @@ -1083,7 +1097,7 @@ class QueryController extends ThinkController if ($page) { $this->assign('_page', $page); } - + $this->meta_title = '市场结算管理'; $this->assign('data',$data); $this->display(); diff --git a/Application/Admin/View/Query/marketList.html b/Application/Admin/View/Query/marketList.html new file mode 100644 index 000000000..d8890f4c4 --- /dev/null +++ b/Application/Admin/View/Query/marketList.html @@ -0,0 +1,464 @@ + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + +
+ 搜索 +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
时间会长账号内外团归属类型游戏名称总流水上游结算流水下游结算流水绩优流水
aOh! 暂时还没有内容!
{$data.my_time}{$data.account}{$data.company_belong}{$data.company_relation}{$data.game_names}{$data.pay_amount}{$data.upstream}{$data.downstream}{$data.highquality}
+
+ +
+
+ + 导出 + + {$_page|default=''} +
+ + + +
+ + + + + +