From 767ce5734dc8670fad781e836ad0cf5360c76ddc Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 5 Nov 2020 16:19:16 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E4=B8=9A=E7=BB=A9?= =?UTF-8?q?=E9=87=8D=E7=AE=97=E5=8F=AA=E9=87=8D=E7=AE=97=E4=B8=8A=E4=B8=AA?= =?UTF-8?q?=E6=9C=88=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/TimingController.class.php | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index 3c7825d35..be2419b2c 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -841,7 +841,8 @@ class TimingController extends AdminController { public function test() { // $this->getSpecialComplement(strtotime(date("Y-m-1",strtotime("2020-07"))),strtotime(date("Y-m-t",strtotime("2020-07")))+86399,2259); - dump(D("CompanyGameRatio")->getPromoteCompanyGameRatio(64,(string)211,1596211200,1598889599,1)); +// dump(D("CompanyGameRatio")->getPromoteCompanyGameRatio(64,(string)211,1596211200,1598889599,1)); + $this->createMarketBonus("all"); } @@ -990,10 +991,12 @@ class TimingController extends AdminController { $belong_map = []; $month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')); - $month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-2).'-01')); +// $month_time[] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-2).'-01')); $map['pay_time'] = ['in',$month_time]; $spend_map['pay_time'] = ['elt',strtotime(date('Y-m-t 23:59:59', strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')))]; + $time_end = strtotime(date('Y-m-t',strtotime($month_time))); + } else { $month_time = $map['pay_time']; $time_start = strtotime(date('Y-m-1',strtotime($map['pay_time']))); @@ -1038,6 +1041,11 @@ class TimingController extends AdminController { } } + + if (!$value['end_time']) { + $value['end_time'] = $time_end; + } + $value['game_ids'] = implode(',',$value['game_ids']); if (!$spend_map['_string']) { @@ -1169,7 +1177,7 @@ class TimingController extends AdminController { ->join("left join tab_promote_company company on promote.company_id = company.id") ->join("left join ({$data}) auth on auth.uid=market_admin_id") ->where(['develop_type'=>['egt',1],'group_id'=>['in',['11','12','21']]]) -// ->where(['company_id'=>313,'spend.promote_id'=>4359,'relation_game_id'=>191]) +// ->where(['company_id'=>278,'spend.promote_id'=>3917,'relation_game_id'=>213]) // ->order("is_settlement ASC") ->select(); @@ -1243,7 +1251,7 @@ class TimingController extends AdminController { } elseif($value['is_settlement'] == '1') { if ($ck == 0) { - +// echo 1; if ($cv['begin_time'] >= $begin_pay_time) { $promote_data[$key]['promote_amount'] += $this->getCompanyGameRadio($value['admin_id'],$value['promote_id'],$value['company_id'],$value['relation_game_id'],$begin_pay_time,$cv['begin_time']-1,$value['pay_amount']); @@ -1255,15 +1263,17 @@ class TimingController extends AdminController { if (!$company_belong_game[$ck+1]) { +// dump($end_pay_time); +// dump($cv['end_time']); if ($end_pay_time > $cv['end_time']) { - +// echo 2; $promote_data[$key]['promote_amount'] += $this->getCompanyGameRadio($value['admin_id'],$value['promote_id'],$value['company_id'],$value['relation_game_id'],$cv['end_time']+86400,$end_pay_time,$value['pay_amount']); } } if ($ck > 1) { - +// echo 3; if (($cv['begin_time'] - $company_belong_game[$ck-1]['end_time'] + 86399) > 1) { $promote_data[$key]['promote_amount'] += $this->getCompanyGameRadio($value['admin_id'],$value['promote_id'],$value['company_id'],$value['relation_game_id'],$company_belong_game[$ck-1]['end_time'] + 86400,$cv['begin_time']-1,$value['pay_amount']); @@ -1271,12 +1281,17 @@ class TimingController extends AdminController { } if (!in_array($value['relation_game_id'],$ungame_ids)) { - +// echo 4; if (($cv['end_time']+86399) > $end_pay_time) { $cv['end_time'] = $end_pay_time; } else { $cv['end_time'] = $cv['end_time']+86399; } + + if ($cv['begin_time'] < $begin_pay_time) { + $cv['begin_time'] = $begin_pay_time; + } + // dump($promote_data[$key]['promote_amount']); // dump(date($cv['begin_time'])."-".date($cv['end_time'])); $promote_data[$key]['promote_amount'] += $this->getCompanyGameRadio($value['admin_id'],$value['promote_id'],$value['company_id'],$value['relation_game_id'],$cv['begin_time'],$cv['end_time'],$value['pay_amount']); @@ -1430,11 +1445,12 @@ class TimingController extends AdminController { $pay_time = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')); $map['pay_time'] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')); } +// dump(date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')));die(); if ($pay_time == 'all') { $end = date("Y-m",time()); - $start = '2019-08'; + $start = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01')); $i = 0; do { $date = date('Y-m', strtotime($start . ' + ' . $i . ' month')); @@ -1443,8 +1459,8 @@ class TimingController extends AdminController { $this->insertAllUserBonus($date); } while ($date < date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01'))); -// $map['pay_time'] = []; - unset($map['pay_time']); + $map['pay_time'] = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01'));; +// unset($map['pay_time']); } else{ M("market_altogether","tab_")->where(['pay_time'=>$pay_time])->delete(); $this->insertAllUserBonus($pay_time); @@ -1484,7 +1500,7 @@ class TimingController extends AdminController { // dump($market_percentage); $settleup_marketorder = M("settleup_marketorder","tab_") - ->where(['admin_id'=>$value['admin_id'],'pay_time'=>$value['pay_time']]) + ->where(['admin_id'=>$value['admin_id'],'pay_time'=>$value['pay_time'],'is_settlement'=>1]) ->select(); $all_data[$key]['performance_commission'] = 0; From 58ff5ad1ed3486446477ca8fe473f12cfee18ea5 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 9 Nov 2020 14:04:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E7=BB=9F=E8=AE=A1--?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=89=80=E5=B1=9E=E5=95=86=E6=88=B7=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/FinanceController.class.php | 16 ++++++++++++++-- .../FinancePromoteController.class.php | 13 ++++++++++++- .../Admin/View/Finance/gameStatisticsDetail.html | 5 ++++- .../FinancePromote/gameStatisticsDetail.html | 5 ++++- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 293b449c1..89f6425a1 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -1007,7 +1007,7 @@ class FinanceController extends ThinkController $map['game_player_name'] = array('like',I("user_nickname").'%'); } // var_dump($map);die(); - $field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version"; + $field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version,merchant_id"; $group = ""; $order = "payed_time DESC"; @@ -1017,7 +1017,18 @@ class FinanceController extends ThinkController $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); } + $merchant_data = M("payment_merchant","tab_") + ->field("id,name") + ->where("1=1") + ->select(); + $handle_merchant = []; + + foreach ($merchant_data as $key => $value) { + $handle_merchant[$value['id']] = $value['name']; + } + foreach($data as $key => $value) { + $data[$key]['merchant_name'] = $handle_merchant[$value['merchant_id']]; $data[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); @@ -1044,7 +1055,8 @@ class FinanceController extends ThinkController "game_player_name"=>"角色名称", "cost"=>"订单金额", "pay_amount"=>"实付金额", - "pay_way"=>"充值方式" + "pay_way"=>"充值方式", + "merchant_name"=>"商户" ); addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-订单查看-导出"]); data2csv($data,"游戏统计订单查看",$dcop); diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 66bb88351..2ce12a647 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -784,7 +784,7 @@ class FinancePromoteController extends AdminController if (!empty(I('user_nickname'))) { $map['game_player_name'] = array('like',I("user_nickname").'%'); } - $field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,sdk_version,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,market_admin_id"; + $field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,sdk_version,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,market_admin_id,merchant_id"; $group = ""; $order = "pay_time DESC"; if(isset($_REQUEST['export'])){ @@ -798,7 +798,18 @@ class FinancePromoteController extends AdminController $marketAdmins = getAdminUsernameList(array_column($data, 'market_admin_id')); } + $merchant_data = M("payment_merchant","tab_") + ->field("id,name") + ->where("1=1") + ->select(); + $handle_merchant = []; + + foreach ($merchant_data as $key => $value) { + $handle_merchant[$value['id']] = $value['name']; + } + foreach($data as $key => $value) { + $data[$key]['merchant_name'] = $handle_merchant[$value['merchant_id']]; $data[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); diff --git a/Application/Admin/View/Finance/gameStatisticsDetail.html b/Application/Admin/View/Finance/gameStatisticsDetail.html index b3ff89c42..f322f2ce4 100644 --- a/Application/Admin/View/Finance/gameStatisticsDetail.html +++ b/Application/Admin/View/Finance/gameStatisticsDetail.html @@ -131,6 +131,8 @@ 实付金额 充值方式 + + 商户 @@ -160,11 +162,12 @@ {$data.cost} {$data.pay_amount} {$data.pay_way} + {$data.merchant_name} 总计 - 累计充值:{$sumAll}0 + 累计充值:{$sumAll}0 (现金金额:{$sumCash} 平台币:{$sumBalance} 绑币:{$sumInside}) diff --git a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html index 24799c82c..42a4dcddc 100644 --- a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html +++ b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html @@ -186,6 +186,8 @@ 实付金额 充值方式 + + 商户 @@ -216,11 +218,12 @@ {$data.cost} {$data.pay_amount} {$data.pay_way} + {$data.merchant_name} 总计 - 累计充值:{$sumAll}0 + 累计充值:{$sumAll}0 (现金金额:{$sumCash} 平台币:{$sumBalance} 绑币:{$sumInside}) From deee3228dd9753360adc33341501cba99441b3ae Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 9 Nov 2020 14:12:56 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/FinancePromoteController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 2ce12a647..dc8eb326d 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -842,6 +842,7 @@ class FinancePromoteController extends AdminController "cost"=>"订单金额", "pay_amount"=>"实付金额", "pay_way"=>"充值方式", + "merchant_name"=>"商户", )); } $totalData = self::totalGameStatisticsData($map, false); From 3f04fa1507ee762372af7eb2fd6be2487167cceb Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 9 Nov 2020 14:15:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/FinanceController.class.php | 2 +- Application/Admin/Controller/FinancePromoteController.class.php | 2 +- Application/Admin/View/Finance/gameStatisticsDetail.html | 2 +- Application/Admin/View/FinancePromote/gameStatisticsDetail.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 89f6425a1..30f5020f7 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -1056,7 +1056,7 @@ class FinanceController extends ThinkController "cost"=>"订单金额", "pay_amount"=>"实付金额", "pay_way"=>"充值方式", - "merchant_name"=>"商户" + "merchant_name"=>"所属商户" ); addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-游戏统计-订单查看-导出"]); data2csv($data,"游戏统计订单查看",$dcop); diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index dc8eb326d..79cee5db9 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -842,7 +842,7 @@ class FinancePromoteController extends AdminController "cost"=>"订单金额", "pay_amount"=>"实付金额", "pay_way"=>"充值方式", - "merchant_name"=>"商户", + "merchant_name"=>"所属商户", )); } $totalData = self::totalGameStatisticsData($map, false); diff --git a/Application/Admin/View/Finance/gameStatisticsDetail.html b/Application/Admin/View/Finance/gameStatisticsDetail.html index f322f2ce4..50991f100 100644 --- a/Application/Admin/View/Finance/gameStatisticsDetail.html +++ b/Application/Admin/View/Finance/gameStatisticsDetail.html @@ -132,7 +132,7 @@ 充值方式 - 商户 + 所属商户 diff --git a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html index 42a4dcddc..f0a8dd153 100644 --- a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html +++ b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html @@ -187,7 +187,7 @@ 充值方式 - 商户 + 所属商户 From 6021f91604f7b02b0e38255119222df1aacdb23d Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 9 Nov 2020 14:34:12 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=80=E5=B1=9E=E5=95=86=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/FinanceController.class.php | 4 ++++ .../Admin/Controller/FinancePromoteController.class.php | 5 +++++ Application/Admin/View/Finance/gameStatisticsDetail.html | 9 +++++++++ .../Admin/View/FinancePromote/gameStatisticsDetail.html | 9 +++++++++ 4 files changed, 27 insertions(+) diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 30f5020f7..6245f8322 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -984,6 +984,10 @@ class FinanceController extends ThinkController $map['promote_id'] = $_REQUEST['root_id']; } + if ($_REQUEST['merchant_id']){ + $map['merchant_id'] = $_REQUEST['merchant_id']; + } + $promote_id = implode(',',$promote_id); if ($promote_id) { $map['promote_id'] = ['in',$promote_id]; diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 79cee5db9..894738ec6 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -784,6 +784,11 @@ class FinancePromoteController extends AdminController if (!empty(I('user_nickname'))) { $map['game_player_name'] = array('like',I("user_nickname").'%'); } + + if ($_REQUEST['merchant_id']){ + $map['merchant_id'] = $_REQUEST['merchant_id']; + } + $field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,sdk_version,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,market_admin_id,merchant_id"; $group = ""; $order = "pay_time DESC"; diff --git a/Application/Admin/View/Finance/gameStatisticsDetail.html b/Application/Admin/View/Finance/gameStatisticsDetail.html index 50991f100..6db8d3462 100644 --- a/Application/Admin/View/Finance/gameStatisticsDetail.html +++ b/Application/Admin/View/Finance/gameStatisticsDetail.html @@ -88,6 +88,15 @@ +
+ +
+ +
+ +
+