From f44a11a91569da302d188551c7d89365c96b1056 Mon Sep 17 00:00:00 2001 From: zyx Date: Mon, 4 Nov 2019 11:56:08 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=9C=88=E7=BB=93=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Finance/gameFinance.html | 2 +- Application/Admin/View/Finance/getParentUser.html | 2 +- Application/Admin/View/Finance/getPromoteUser.html | 2 +- Application/Admin/View/Finance/getRootUser.html | 2 +- Application/Admin/View/Finance/index.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Application/Admin/View/Finance/gameFinance.html b/Application/Admin/View/Finance/gameFinance.html index a49331e4a..21ad29c6d 100644 --- a/Application/Admin/View/Finance/gameFinance.html +++ b/Application/Admin/View/Finance/gameFinance.html @@ -133,7 +133,7 @@
内充消耗绑币消费所产生的流水
-
总流水现金流水+平台币流水+内充流水
+
总流水游戏现金流水+平台币流水+内充消耗
操作 diff --git a/Application/Admin/View/Finance/getParentUser.html b/Application/Admin/View/Finance/getParentUser.html index ea1e0f0bf..bced194f8 100644 --- a/Application/Admin/View/Finance/getParentUser.html +++ b/Application/Admin/View/Finance/getParentUser.html @@ -116,7 +116,7 @@
内充发放平台直接下放给公会的平台币
-
总流水现金流水+平台币流水+内充流水
+
总流水游戏现金流水+平台币流水+内充发放
操作 diff --git a/Application/Admin/View/Finance/getPromoteUser.html b/Application/Admin/View/Finance/getPromoteUser.html index 5108b5b77..74ae6d1dc 100644 --- a/Application/Admin/View/Finance/getPromoteUser.html +++ b/Application/Admin/View/Finance/getPromoteUser.html @@ -107,7 +107,7 @@
内充发放平台直接下放给公会的平台币
-
总流水现金流水+平台币流水+内充流水
+
总流水游戏现金流水+平台币流水+内充发放
操作 diff --git a/Application/Admin/View/Finance/getRootUser.html b/Application/Admin/View/Finance/getRootUser.html index 1201c5762..956e0d3fd 100644 --- a/Application/Admin/View/Finance/getRootUser.html +++ b/Application/Admin/View/Finance/getRootUser.html @@ -117,7 +117,7 @@
内充发放平台直接下放给公会的平台币
-
总流水现金流水+平台币流水+内充流水
+
总流水游戏现金流水+平台币流水+内充发放
操作 diff --git a/Application/Admin/View/Finance/index.html b/Application/Admin/View/Finance/index.html index 4b4f0cfd7..5c79e4f19 100644 --- a/Application/Admin/View/Finance/index.html +++ b/Application/Admin/View/Finance/index.html @@ -139,7 +139,7 @@
平台币支出指示为玩家充值消耗平台,不计入总流水
-
总流水现金流水+平台币流水+内充流水
+
总流水游戏现金流水+平台币收入+内充流水
操作 From 58c405e9142db87debea8e293f132046abccec7c Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Tue, 5 Nov 2019 09:01:27 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SpendCountSetController.class.php | 229 +++++++----------- 1 file changed, 86 insertions(+), 143 deletions(-) diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index eb0dd284b..6d8f3709f 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -23,6 +23,7 @@ class SpendCountSetController extends \Think\Controller $this->model =M("spend_count",'tab_'); $this->usermodel =M("spend_user_count",'tab_'); $this->monthmodel =M("spend_month_count",'tab_'); + $this->gamemodel =M("spend_count",'tab_'); } /** @@ -101,147 +102,89 @@ class SpendCountSetController extends \Think\Controller $this->getRoot(); # code... } - //获取游戏现金流水 - protected function getCashData() - { - if(!$this->continue){ - die("api error"); - } - $map = array( - "pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), - "spend.pay_status"=>1, - "pay_way"=>array("GT",0) - ); - $field = "IFNULL(game.partner_id,0) partner_id,partner.partner partner_name, - spend.promote_id,spend.promote_account,spend.game_id,spend.game_name, - IFNULL(promote.parent_id,0) parent_id,promote.parent_name,sum(pay_amount) cash_count, - '{$this->date}' as count_date,'{$this->nowdata}' as create_time"; - //获取现金 - $cashRes = M() - ->table("tab_spend spend") - ->field($field) - ->where($map) - ->join("tab_promote promote ON spend.promote_id = promote.id","left") - ->join("tab_game game ON spend.game_id = game.id","left") - ->join("tab_partner partner ON partner.id = game.partner_id","left") - ->group('spend.promote_id,spend.game_id') - ->select(); - if(!empty($cashRes)){ - $dbres = $this->model->addAll($cashRes); - if(!$dbres){ - $this->model->rollback(); - die("error"); - } - } - # code... - } - //获取平台币聚合 - protected function getBalanceData() - { - if(!$this->continue){ - die("api error"); - } - $map = array( - "pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), - "spend.pay_status"=>1, - "pay_way"=> array("EQ",0) - ); - $field = "IFNULL(game.partner_id,0) partner_id,partner.partner partner_name, - spend.promote_id,spend.promote_account,spend.game_id,spend.game_name, - IFNULL(promote.parent_id,0) parent_id,promote.parent_name,sum(pay_amount) balance_coin_count, - '{$this->date}' as count_date,'{$this->nowdata}' as create_time"; - $balanceRes = M() - ->table("tab_spend spend") - ->field($field) - ->where($map) - ->join("tab_promote promote ON spend.promote_id = promote.id","left") - ->join("tab_game game ON spend.game_id = game.id","left") - ->join("tab_partner partner ON partner.id = game.partner_id","left") - ->group('spend.promote_id,spend.game_id') - ->select(); - //集中两个表 - if(!empty($balanceRes)){ - - for ($i=0; $i < count($balanceRes); $i++) { - # code... - $tempmap = array( - "game_id"=>$balanceRes[$i]['game_id'], - "promote_id"=>$balanceRes[$i]['promote_id'], - "count_date"=>$this->date - ); - $dbres = $this->model->where($tempmap)->find(); - if(!$dbres){ - //不存在 - $tempdbres = $this->model->add($balanceRes[$i]); - if(!$tempdbres){ - $this->model->rollback(); - die("error"); - } - }else{ - $dbres["balance_coin_count"] = $balanceRes[$i]['balance_coin_count']; - $tempdbres = $this->model->save($dbres); - if(!$tempdbres){ - $this->model->rollback(); - die("error"); - } - } - } - } - # code... - } - //获取绑定币充值 - protected function getInsideData() - { - if(!$this->continue){ - die("api error"); - } - $map = array( - "pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), - "spend.pay_status"=>1, - "pay_way"=> array("LT",0) - ); - $field = "IFNULL(game.partner_id,0) partner_id,partner.partner partner_name, - spend.promote_id,spend.promote_account,spend.game_id,spend.game_name, - IFNULL(promote.parent_id,0) parent_id,promote.parent_name,sum(pay_amount) inside_cash_count, - '{$this->date}' as count_date,'{$this->nowdata}' as create_time"; - $balanceRes = M() - ->table("tab_spend spend") - ->field($field) - ->where($map) - ->join("tab_promote promote ON spend.promote_id = promote.id","left") - ->join("tab_game game ON spend.game_id = game.id","left") - ->join("tab_partner partner ON partner.id = game.partner_id","left") - ->group('spend.promote_id,spend.game_id') - ->select(); - //集中两个表 - if(!empty($balanceRes)){ - - for ($i=0; $i < count($balanceRes); $i++) { - # code... - $tempmap = array( - "game_id"=>$balanceRes[$i]['game_id'], - "promote_id"=>$balanceRes[$i]['promote_id'], - "count_date"=>$this->date - ); - $dbres = $this->model->where($tempmap)->find(); - if(!$dbres){ - //不存在 - $tempdbres = $this->model->add($balanceRes[$i]); - if(!$tempdbres){ - $this->model->rollback(); - die("error"); - } - }else{ - $dbres["inside_cash_count"] = $balanceRes[$i]['inside_cash_count']; - $tempdbres = $this->model->save($dbres); - if(!$tempdbres){ - $this->model->rollback(); - die("error"); - } - } - } - } - } + //获取游戏现金流水 + protected function getCashData() + { + $this->createGameCount("cash_count"); + } + //获取平台币聚合 + protected function getBalanceData() + { + $this->createGameCount("balance_coin_count"); + } + //获取绑定币充值 + protected function getInsideData() + { + $this->createGameCount("inside_cash_count"); + + } + protected function createGameCount($type) + { + $map = array( + "pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), + "spend.pay_status"=>1 + ); + + if($type == "cash_count"){ + //现金统计 + $map['pay_way'] = array("GT",0); + }elseif($type == "balance_coin_count"){ + $map['pay_way']= array("EQ",0); + }elseif($type == "inside_cash_count"){ + $map['pay_way']= array("LT",0); + } + $field = "IFNULL(game.partner_id,0) partner_id,partner.partner partner_name, + spend.promote_id,spend.promote_account,spend.game_id,spend.game_name,sum(pay_amount) {$type}, + IFNULL(promote.parent_id,0) parent_id,promote.parent_name, + '{$this->date}' as count_date,'{$this->nowdata}' as create_time"; + $spendRes = M() + ->table("tab_spend spend") + ->field($field) + ->where($map) + ->join("tab_promote promote ON spend.promote_id = promote.id","left") + ->join("tab_game game ON spend.game_id = game.id","left") + ->join("tab_partner partner ON partner.id = game.partner_id","left") + ->group('spend.promote_id,spend.game_id') + ->select(); + if(empty($spendRes)){ + return ; + } + //集中两个表 + if($type == "cash_count"){ + $dbres = $this->gamemodel->addAll($spendRes); + if(!$dbres){ + $this->model->rollback(); + die("error"); + } + }else{ + for ($i=0; $i < count($spendRes); $i++) { + $spendRes[$i][$type] || $spendRes[$i][$type]=0; + # code... + $tempmap = array( + "game_id"=>$spendRes[$i]['game_id'], + "promote_id"=>$spendRes[$i]['promote_id'], + "count_date"=>$this->date + ); + $dbres = $this->gamemodel->where($tempmap)->find(); + if(!$dbres){ + //不存在 + $tempdbres = $this->gamemodel->add($spendRes[$i]); + if(!$tempdbres){ + $this->model->rollback(); + die("error"); + } + }else{ + $dbres[$type] = $dbres[$type]-0+$spendRes[$i][$type]; + $tempdbres = $this->gamemodel->save($dbres); + if($tempdbres === false){ + $this->model->rollback(); + die("error"); + } + } + } + } + # code... + } protected function getRoot() { @@ -252,7 +195,7 @@ class SpendCountSetController extends \Think\Controller "parent_id"=>array("GT",0), "count_date"=>$this->date ); - $user = $this->model->field("parent_id,promote_id")->where($map)->group("promote_id")->select(); + $user = $this->gamemodel->field("parent_id,promote_id")->where($map)->group("promote_id")->select(); $Promote=M("promote","tab_"); for ($i=0; $i < count($user); $i++) { # code... @@ -267,7 +210,7 @@ class SpendCountSetController extends \Think\Controller "promote_id"=>$user[$i]['promote_id'], "count_date"=>$this->date ); - $tempdbres = $this->model->where($where)->save($root); + $tempdbres = $this->gamemodel->where($where)->save($root); if(!$tempdbres){ $this->model->rollback(); die("setRoot error"); From 0ae24bf2cd7a444a33136bbc5fe131f5e18ac35e Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Tue, 5 Nov 2019 10:02:50 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B4=A2=E5=8A=A1?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8E=A5=E5=8F=A32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SpendCountSetController.class.php | 55 +++++++++++++------ Data/update.sql | 7 +++ 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index 6d8f3709f..2ed4f922c 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -239,19 +239,22 @@ class SpendCountSetController extends \Think\Controller $month = $this->date; $from = " ( - SELECT root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE root_id > 0 and count_date='{$month}' group by root_id + SELECT root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count FROM tab_spend_count WHERE root_id > 0 and count_date='{$month}' group by root_id UNION ALL - SELECT promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id = 0 and count_date='{$month}' group by promote_id + SELECT promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count FROM tab_spend_count WHERE parent_id = 0 and count_date='{$month}' group by promote_id UNION ALL - SELECT parent_id,parent_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id > 0 and root_id = 0 and count_date='{$month}' group by parent_id + SELECT parent_id,parent_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count FROM tab_spend_count WHERE parent_id > 0 and root_id = 0 and count_date='{$month}' group by parent_id ) "; $subQueryAll = M()->table($from." a") - ->field('root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count') + ->field('root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(bind_coin_count) bind_coin_count') ->group("a.root_id") // ->having("cash_count > 0 OR balance_coin_count > 0") ->select(); for ($i=0; $i$subQueryAll[$i]['root_id'], "promote_account"=>$subQueryAll[$i]['root_name'], @@ -261,7 +264,8 @@ class SpendCountSetController extends \Think\Controller "root_name"=>'官方渠道', "cash_count"=>$subQueryAll[$i]['cash_count'], "balance_coin_count"=>$subQueryAll[$i]['balance_coin_count'], - "all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count'], + "bind_coin_count"=>$subQueryAll[$i]['bind_coin_count'], + "all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count']-0+$subQueryAll[$i]['bind_coin_count'], "count_date"=>$this->date, "create_time"=>$this->nowdata ); @@ -281,17 +285,20 @@ class SpendCountSetController extends \Think\Controller //获取数据 $from = " ( - SELECT parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE root_id > 0 and count_date='{$month}' group by parent_id + SELECT parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count FROM tab_spend_count WHERE root_id > 0 and count_date='{$month}' group by parent_id UNION - SELECT promote_id,promote_account,parent_id,parent_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id >0 and root_id = 0 and count_date='{$month}' group by promote_id + SELECT promote_id,promote_account,parent_id,parent_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count FROM tab_spend_count WHERE parent_id >0 and root_id = 0 and count_date='{$month}' group by promote_id ) "; $subQueryAll = M()->table($from." a") - ->field('parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count') + ->field('parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(bind_coin_count) bind_coin_count') ->group("a.parent_id") // ->having("cash_count > 0 or balance_coin_count > 0 ") ->select(); for ($i=0; $i$subQueryAll[$i]['parent_id'], "promote_account"=>$subQueryAll[$i]['parent_name'], @@ -301,7 +308,8 @@ class SpendCountSetController extends \Think\Controller "root_name"=>'官方渠道', "cash_count"=>$subQueryAll[$i]['cash_count'], "balance_coin_count"=>$subQueryAll[$i]['balance_coin_count'], - "all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count'], + "bind_coin_count"=>$subQueryAll[$i]['bind_coin_count'], + "all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count']-0+$subQueryAll[$i]['bind_coin_count'], "count_date"=>$this->date, "create_time"=>$this->nowdata ); @@ -321,7 +329,7 @@ class SpendCountSetController extends \Think\Controller //获取数据 $from = " ( - SELECT promote_id,promote_account,parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count FROM tab_spend_count WHERE parent_id > 0 and root_id > 0 and count_date='{$month}' group by promote_id + SELECT promote_id,promote_account,parent_id,parent_name,root_id,root_name,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) bind_coin_count FROM tab_spend_count WHERE parent_id > 0 and root_id > 0 and count_date='{$month}' group by promote_id ) "; $subQueryAll = M()->table($from." a") @@ -330,6 +338,9 @@ class SpendCountSetController extends \Think\Controller // ->having("cash_count > 0 or balance_coin_count > 0") ->select(); for ($i=0; $i$subQueryAll[$i]['promote_id'], "promote_account"=>$subQueryAll[$i]['promote_account'], @@ -339,7 +350,8 @@ class SpendCountSetController extends \Think\Controller "root_name"=>$subQueryAll[$i]['root_name'], "cash_count"=>$subQueryAll[$i]['cash_count'], "balance_coin_count"=>$subQueryAll[$i]['balance_coin_count'], - "all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count'], + "bind_coin_count"=>$subQueryAll[$i]['bind_coin_count'], + "all_count"=>$subQueryAll[$i]['cash_count']-0+$subQueryAll[$i]['balance_coin_count']-0+$subQueryAll[$i]['bind_coin_count'], "count_date"=>$this->date, "create_time"=>$this->nowdata ); @@ -390,20 +402,20 @@ class SpendCountSetController extends \Think\Controller "parent_id"=>0, "root_id"=>0, "inside_cash_count"=>$inside_cash_count, - "all_count"=>$inside_cash_count, + // "all_count"=>$inside_cash_count, "count_date"=>$this->date, "create_time"=>$this->nowdata ); $tempparentarr=array( "root_id"=>0, "inside_cash_count"=>$inside_cash_count, - "all_count"=>$inside_cash_count, + // "all_count"=>$inside_cash_count, "count_date"=>$this->date, "create_time"=>$this->nowdata ); $temppromotearr=array( "inside_cash_count"=>$inside_cash_count, - "all_count"=>$inside_cash_count, + // "all_count"=>$inside_cash_count, "count_date"=>$this->date, "create_time"=>$this->nowdata ); @@ -516,7 +528,8 @@ class SpendCountSetController extends \Think\Controller "count_date"=>$this->date ); $dbres = M("spend_user_count","tab_")->where($tempmap)->find(); - $savedata = array("inside_cash_count"=>$inside_cash_count-0+$dbres['inside_cash_count'],"all_count"=>$inside_cash_count-0+$dbres['all_count']); + // $savedata = array("inside_cash_count"=>$inside_cash_count-0+$dbres['inside_cash_count'],"all_count"=>$inside_cash_count-0+$dbres['all_count']); + $savedata = array("inside_cash_count"=>$inside_cash_count-0+$dbres['inside_cash_count']); $tempdbres = $this->usermodel->where($tempmap)->save($savedata); if($tempdbres === false){ $this->usermodel->rollback(); @@ -526,13 +539,21 @@ class SpendCountSetController extends \Think\Controller } /** --------以下为设定月份聚合---------- **/ + /** + * @param 现金流水 cash_count 游戏中充值的现金 + * @param 平台币流水 balance_coin_count 游戏中消耗的平台币 + * @param 绑定币流水 bind_coin_count 游戏中绑定币的消耗 + * @param 内充流水 inside_cash_count:(后台发放给玩家平台币-回收平台币 )+ (后台发放绑币给玩家 -回收的绑币) + * @param 平台币充值 balance_coin_deposit + * @return void + */ public function setMonthCount() { $initdata = $this->getMonthInit(); $balance = $this->getBalanceUser(); $bind = $this->getBindUser(); $deposit = $this->getBalanceDeposit(); - $initdata["inside_cash_count"] = $initdata["inside_cash_count"]-0+$balance-0+$bind; + $initdata["inside_cash_count"] = $balance-0+$bind; $initdata["balance_coin_deposit"] = $deposit; $initdata["all_count"] = $initdata["inside_cash_count"]-0+$initdata["cash_count"]-0+$deposit; $initdata["count_date"] = $this->date; @@ -547,7 +568,7 @@ class SpendCountSetController extends \Think\Controller "count_date"=>$this->date, "parent_id"=>0 ); - return M("spend_user_count","tab_")->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count")->where($tempmap)->find(); + return M("spend_user_count","tab_")->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(bind_coin_count) bind_coin_count")->where($tempmap)->find(); } //获取平台币充值流水 protected function getBalanceDeposit() diff --git a/Data/update.sql b/Data/update.sql index 97991b298..1ad199440 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -251,3 +251,10 @@ CREATE TABLE `tab_spend_month_count` ( ALTER TABLE `tab_spend_month_count` MODIFY COLUMN `balance_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '平台币游戏支付流水' AFTER `cash_count`, ADD COLUMN `balance_coin_deposit` decimal(10,2) NULL DEFAULT 0.00 COMMENT '平台币充值流水' AFTER `balance_coin_count`; + +-- 2019-11-05 chenzhi +ALTER TABLE `tab_spend_month_count` +ADD COLUMN `bind_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '绑币消耗' AFTER `balance_coin_deposit`; + +ALTER TABLE `tab_spend_user_count` +ADD COLUMN `bind_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '绑定币消耗' AFTER `balance_coin_count`; \ No newline at end of file From 4dfec50ba58149d5d996301946abd2f2815b9577 Mon Sep 17 00:00:00 2001 From: zyx Date: Tue, 5 Nov 2019 11:03:51 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=9C=88=E7=BB=93=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 2 ++ .../Controller/FinanceController.class.php | 24 +++++++++++-------- .../Admin/View/Finance/gameFinance.html | 4 ++-- .../Admin/View/Finance/getParentUser.html | 10 +++++--- .../Admin/View/Finance/getPromoteUser.html | 10 +++++--- .../Admin/View/Finance/getRootUser.html | 10 +++++--- Application/Admin/View/Finance/index.html | 4 ++++ 7 files changed, 43 insertions(+), 21 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 89918cb2a..392ec9170 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5444,6 +5444,8 @@ if ($key == 'model'){ foreach ($xlsData as $key => $value) { $xlsData[$key]['inside_cash_count'] = number_format($insideDataSum[$value['game_id']],2,'.',''); + $xlsData[$key]['all_cash_count'] = number_format($insideDataSum[$value['game_id']]+$xlsData[$key]['all_cash_count'],2,'.',''); + } $sumCash = D("spend_count")->sumSpendCountField($map,"cash_count"); diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index e0ca919c0..9f94d658c 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -85,7 +85,7 @@ class FinanceController extends ThinkController $order = "id DESC"; $data = M('spend_month_count','tab_') - ->field("cash_count,balance_coin_count,inside_cash_count,all_count,count_date,balance_coin_deposit") + ->field("cash_count,balance_coin_count,inside_cash_count,all_count,count_date,balance_coin_deposit,bind_coin_count") ->where($map) ->page($page,$row) ->order($order) @@ -98,7 +98,7 @@ class FinanceController extends ThinkController ->select(); $sumData = M('spend_month_count','tab_') - ->field("sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count,sum(all_count) as all_count,count_date,sum(balance_coin_deposit) as balance_coin_deposit") + ->field("sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count,sum(all_count) as all_count,count_date,sum(balance_coin_deposit) as balance_coin_deposit,sum(bind_coin_count) as bind_coin_count") ->where($map) ->order($order) ->find(); @@ -202,6 +202,7 @@ class FinanceController extends ThinkController foreach ($data as $key => $value) { $data[$key]['inside_cash_count'] = number_format($insideDataSum[$value['game_id']],2,'.',''); + $data[$key]['all_cash_count'] = number_format($insideDataSum[$value['game_id']]+$data[$key]['all_cash_count'],2,'.',''); } $sumCash = D("spend_count")->sumSpendCountField($map,"cash_count"); @@ -328,14 +329,14 @@ class FinanceController extends ThinkController $map['parent_id'] = 0; $map['root_id'] = 0; $subQueryAll = M('spend_user_count','tab_') - ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') + ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map) ->group('promote_id') ->page($page,$row) ->select(); $sumData = M('spend_user_count','tab_') - ->field('sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') + ->field('sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map) ->find(); @@ -395,7 +396,7 @@ class FinanceController extends ThinkController $subQueryAll = M('spend_user_count','tab_') - ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') + ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map) ->group('promote_id') ->page($page,$row) @@ -405,7 +406,7 @@ class FinanceController extends ThinkController } $sumData = M('spend_user_count','tab_') - ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') + ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map) ->find(); if (empty(I("root_name"))) { @@ -413,6 +414,7 @@ class FinanceController extends ThinkController $sumData['balance_coin_count'] = number_format($sumData['balance_coin_count'] + $parentData[0]['balance_coin_count'], 2, '.', ''); $sumData['inside_cash_count'] = number_format($sumData['inside_cash_count'] + $parentData[0]['inside_cash_count'], 2, '.', ''); $sumData['all_count'] = number_format($sumData['all_count'] + $parentData[0]['all_count'], 2, '.', ''); + $sumData['bind_coin_count'] = number_format($sumData['bind_coin_count'] + $parentData[0]['bind_coin_count'], 2, '.', ''); } $count = M('spend_user_count','tab_') @@ -466,7 +468,7 @@ class FinanceController extends ThinkController // var_dump($map);die(); $subQueryAll = M('spend_user_count','tab_') - ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') + ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map) ->group('promote_id') ->page($page,$row) @@ -475,13 +477,14 @@ class FinanceController extends ThinkController $subQueryAll = array_merge($parentData,$subQueryAll); $sumData = M('spend_user_count','tab_') - ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') + ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map) ->find(); $sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.',''); $sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.',''); $sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.',''); $sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.',''); + $sumData['bind_coin_count'] = number_format($sumData['bind_coin_count']+$parentData[0]['bind_coin_count'],2,'.',''); $count = M('spend_user_count','tab_') ->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count') @@ -544,19 +547,20 @@ class FinanceController extends ThinkController } $data = M('spend_user_count','tab_') - ->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(cash_count+balance_coin_count+inside_cash_count) as all_count') + ->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map)->select(); $map1['parent_id'] = $data[0]['promote_id']; $map1['count_date'] = $date; $sunData = M('spend_user_count','tab_') - ->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(cash_count+balance_coin_count+inside_cash_count) as all_count') + ->field('promote_id,promote_account, sum(cash_count) as cash_count,sum(balance_coin_count) as balance_coin_count,sum(inside_cash_count) as inside_cash_count, sum(all_count) as all_count, sum(bind_coin_count) as bind_coin_count') ->where($map1)->find(); $data[0]['cash_count'] = number_format($data[0]['cash_count']-$sunData['cash_count'],2,'.',''); $data[0]['balance_coin_count'] = number_format($data[0]['balance_coin_count']-$sunData['balance_coin_count'],2,'.',''); $data[0]['inside_cash_count'] = number_format($data[0]['inside_cash_count']-$sunData['inside_cash_count'],2,'.',''); $data[0]['all_count'] = number_format($data[0]['all_count']-$sunData['all_count'],2,'.',''); + $data[0]['bind_coin_count'] = number_format($data[0]['bind_coin_count']-$sunData['bind_coin_count'],2,'.',''); // $map['inside_cash_count'] = ['neq',0]; // $insideData = D("spend_count")->getSpendCountData($map,"promote_id,inside_cash_count as count","promote_id,count_date"); diff --git a/Application/Admin/View/Finance/gameFinance.html b/Application/Admin/View/Finance/gameFinance.html index 21ad29c6d..dec28f5a5 100644 --- a/Application/Admin/View/Finance/gameFinance.html +++ b/Application/Admin/View/Finance/gameFinance.html @@ -131,9 +131,9 @@
平台币流水平台币所支付的流水
-
内充消耗绑币消费所产生的流水
+
公会内充支出绑币消费所产生的流水
-
总流水游戏现金流水+平台币流水+内充消耗
+
总流水游戏现金流水+平台币流水+公会内充支出
操作 diff --git a/Application/Admin/View/Finance/getParentUser.html b/Application/Admin/View/Finance/getParentUser.html index bced194f8..ca0c96f48 100644 --- a/Application/Admin/View/Finance/getParentUser.html +++ b/Application/Admin/View/Finance/getParentUser.html @@ -112,11 +112,13 @@
游戏现金流水第三方支付(微信,支付宝,快捷)。
-
平台币流水平台币所支付的流水
+
平台币支出平台币所支付的流水
-
内充发放平台直接下放给公会的平台币
+
公会内充发放平台直接下放给公会的平台币
-
总流水游戏现金流水+平台币流水+内充发放
+
公会内充支出绑币消耗流水
+ +
总流水游戏现金流水+平台币支出+公会内充支出=总流水
操作 @@ -141,6 +143,7 @@ {$data.cash_count} {$data.balance_coin_count} {$data.inside_cash_count} + {$data.bind_coin_count} {$data.all_count} 游戏查看 @@ -154,6 +157,7 @@ {$sumData.cash_count} {$sumData.balance_coin_count} {$sumData.inside_cash_count} + {$sumData.bind_coin_count} {$sumData.all_count} 游戏查看 diff --git a/Application/Admin/View/Finance/getPromoteUser.html b/Application/Admin/View/Finance/getPromoteUser.html index 74ae6d1dc..385bc2a95 100644 --- a/Application/Admin/View/Finance/getPromoteUser.html +++ b/Application/Admin/View/Finance/getPromoteUser.html @@ -103,11 +103,13 @@
游戏现金流水第三方支付(微信,支付宝,快捷)。
-
平台币流水平台币所支付的流水
+
平台币支出平台币所支付的流水
-
内充发放平台直接下放给公会的平台币
+
公会内充发放平台直接下放给公会的平台币
-
总流水游戏现金流水+平台币流水+内充发放
+
公会内充支出绑币消耗流水
+ +
总流水游戏现金流水+平台币支出+公会内充支出=总流水/span>
操作 @@ -132,6 +134,7 @@ {$data.cash_count} {$data.balance_coin_count} {$data.inside_cash_count} + {$data.bind_coin_count} {$data.all_count} 游戏查看 @@ -144,6 +147,7 @@ {$sumData.cash_count} {$sumData.balance_coin_count} {$sumData.inside_cash_count} + {$sumData.bind_coin_count} {$sumData.all_count} 游戏查看 diff --git a/Application/Admin/View/Finance/getRootUser.html b/Application/Admin/View/Finance/getRootUser.html index 956e0d3fd..76862520f 100644 --- a/Application/Admin/View/Finance/getRootUser.html +++ b/Application/Admin/View/Finance/getRootUser.html @@ -113,11 +113,13 @@
游戏现金流水第三方支付(微信,支付宝,快捷)。
-
平台币流水平台币所支付的流水
+
平台币支出平台币所支付的流水
-
内充发放平台直接下放给公会的平台币
+
公会内充发放平台直接下放给公会的平台币
-
总流水游戏现金流水+平台币流水+内充发放
+
公会内充支出绑币消耗流水
+ +
总流水游戏现金流水+平台币支出+公会内充支出=总流水
操作 @@ -142,6 +144,7 @@ {$data.cash_count} {$data.balance_coin_count} {$data.inside_cash_count} + {$data.bind_coin_count} {$data.all_count} 游戏查看 组长渠道 @@ -151,6 +154,7 @@ {$sumData.cash_count} {$sumData.balance_coin_count} {$sumData.inside_cash_count} + {$sumData.bind_coin_count} {$sumData.all_count} 游戏查看 diff --git a/Application/Admin/View/Finance/index.html b/Application/Admin/View/Finance/index.html index 5c79e4f19..9573c7c43 100644 --- a/Application/Admin/View/Finance/index.html +++ b/Application/Admin/View/Finance/index.html @@ -137,6 +137,8 @@
内充流水管理后台下发的所有平台币,绑定币流水(平台币订单-后台发放(玩家/推广员)),绑币订单-后台发放(玩家),平台币回收与绑币回收需要进行扣除
+
内充支出绑定币流水
+
平台币支出指示为玩家充值消耗平台,不计入总流水
总流水游戏现金流水+平台币收入+内充流水
@@ -163,6 +165,7 @@ {$data.cash_count} {$data.balance_coin_deposit} {$data.inside_cash_count} + {$data.bind_coin_count} {$data.balance_coin_count} {$data.all_count} @@ -179,6 +182,7 @@ {$sumData.cash_count}0 {$sumData.balance_coin_deposit}0 {$sumData.inside_cash_count}0 + {$sumData.bind_coin_count}0 {$sumData.balance_coin_count}0 {$sumData.all_count}0 From 8fd435a324379b5ed63cd2bc2e07e45f666cb9a2 Mon Sep 17 00:00:00 2001 From: zyx Date: Tue, 5 Nov 2019 14:17:23 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=9C=88=E7=BB=93=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=EF=BC=8C=E6=B8=B8=E6=88=8F=E6=9F=A5=E7=9C=8B=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Finance/gameFinance.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/View/Finance/gameFinance.html b/Application/Admin/View/Finance/gameFinance.html index dec28f5a5..cc67e94bc 100644 --- a/Application/Admin/View/Finance/gameFinance.html +++ b/Application/Admin/View/Finance/gameFinance.html @@ -129,11 +129,11 @@
游戏现金流水第三方支付(微信,支付宝,快捷)。
-
平台币流水平台币所支付的流水
+
平台币支出平台币所支付的流水
公会内充支出绑币消费所产生的流水
-
总流水游戏现金流水+平台币流水+公会内充支出
+
总流水游戏现金流水+平台币支出+公会内充支出
操作 From a9bc64a4b2e432456caffcc2a5fbdf02ada667ff Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Tue, 5 Nov 2019 15:14:12 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/SpendCountSetController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index 2ed4f922c..2fbed024c 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -543,7 +543,7 @@ class SpendCountSetController extends \Think\Controller * @param 现金流水 cash_count 游戏中充值的现金 * @param 平台币流水 balance_coin_count 游戏中消耗的平台币 * @param 绑定币流水 bind_coin_count 游戏中绑定币的消耗 - * @param 内充流水 inside_cash_count:(后台发放给玩家平台币-回收平台币 )+ (后台发放绑币给玩家 -回收的绑币) + * @param 内充流水 inside_cash_count:(推广员的平台币发放-收回)+(后台发放给玩家平台币-回收平台币 )+ (后台发放绑币给玩家 -回收的绑币) * @param 平台币充值 balance_coin_deposit * @return void */ @@ -553,7 +553,7 @@ class SpendCountSetController extends \Think\Controller $balance = $this->getBalanceUser(); $bind = $this->getBindUser(); $deposit = $this->getBalanceDeposit(); - $initdata["inside_cash_count"] = $balance-0+$bind; + $initdata["inside_cash_count"] = $initdata["inside_cash_count"]-0+$balance-0+$bind; $initdata["balance_coin_deposit"] = $deposit; $initdata["all_count"] = $initdata["inside_cash_count"]-0+$initdata["cash_count"]-0+$deposit; $initdata["count_date"] = $this->date; @@ -568,7 +568,7 @@ class SpendCountSetController extends \Think\Controller "count_date"=>$this->date, "parent_id"=>0 ); - return M("spend_user_count","tab_")->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(bind_coin_count) bind_coin_count")->where($tempmap)->find(); + return M("spend_user_count","tab_")->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(bind_coin_count) bind_coin_count,sum(inside_cash_count) inside_cash_count")->where($tempmap)->find(); } //获取平台币充值流水 protected function getBalanceDeposit() From 1561e719778b84834764a8eb174d73eeb55a3557 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 5 Nov 2019 17:04:38 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0->?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=AE=89=E5=85=A8=E5=AF=86=E7=A0=81--?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/BaseController.class.php | 291 ++++++++++-------- .../Controller/FinanceController.class.php | 9 +- .../Controller/GameDivideController.class.php | 27 +- .../Controller/PromoteController.class.php | 9 +- .../View/default/Finance/settlementDtl.html | 215 +++++-------- .../Home/View/default/GameDivide/index.html | 244 +++++---------- .../Promote/setChildGamePermission.html | 80 +---- .../View/default/Public/verify_password.html | 198 ++++++++++++ 8 files changed, 555 insertions(+), 518 deletions(-) create mode 100644 Application/Home/View/default/Public/verify_password.html diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index b43c29817..c168b29ad 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -1,7 +1,11 @@ login(); - + $loginer = $this->getLoginPromote(); $pid = is_login_promote(); define('PLEVEL', $loginer['parent_id']); define('PID', $pid); - define('PROMOTE_ACCOUNT',session('promote_auth.account')); - - if($loginer['grand_id']>0) {/* 三级 */ - define('PRO_GRADE',3); - } elseif($loginer['parent_id']>0) {/* 二级 */ - define('PRO_GRADE',2); - define('SETTLEMENT_GRADE','third_status'); /* 给三级结算 */ - define('G_SETTLEMENT_GRADE','third_status'); + define('PROMOTE_ACCOUNT', session('promote_auth.account')); + + if ($loginer['grand_id'] > 0) {/* 三级 */ + define('PRO_GRADE', 3); + } elseif ($loginer['parent_id'] > 0) {/* 二级 */ + define('PRO_GRADE', 2); + define('SETTLEMENT_GRADE', 'third_status'); /* 给三级结算 */ + define('G_SETTLEMENT_GRADE', 'third_status'); } else {/* 一级 */ - define('PRO_GRADE',1); - define('SETTLEMENT_GRADE','sub_status'); /* 给二级结算 */ - define('G_SETTLEMENT_GRADE','sub_status,third_status'); + define('PRO_GRADE', 1); + define('SETTLEMENT_GRADE', 'sub_status'); /* 给二级结算 */ + define('G_SETTLEMENT_GRADE', 'sub_status,third_status'); } - + $this->assign('loginer', $loginer); $this->assign("parent_id", $loginer['parent_id']); $this->assign("grand_id", $loginer['grand_id']); - $result = M('site_apply','tab_')->where("promote_id=$pid")->getField('status'); - if($result['status'] == 1) { - $this -> assign('noapplysite', $result); + $result = M('site_apply', 'tab_')->where("promote_id=$pid")->getField('status'); + if ($result['status'] == 1) { + $this->assign('noapplysite', $result); } - if (in_array(CONTROLLER_NAME,array('SiteBase','SiteGame','SiteGift','SiteGroup','SiteServer','SiteAdv'))) { - if ($result != 1) { - $this->redirect('SiteApply/index',array('msg'=>1)); - } + if (in_array(CONTROLLER_NAME, array('SiteBase', 'SiteGame', 'SiteGift', 'SiteGroup', 'SiteServer', 'SiteAdv'))) { + if ($result != 1) { + $this->redirect('SiteApply/index', array('msg' => 1)); + } } } - - /* 用户登录检测 */ - protected function login(){ + protected function login() + { /* 用户登录检测 */ is_login_promote() || $this->error('您还没有登录,请先登录!', U('Index/index')); } @@ -56,10 +59,11 @@ class BaseController extends HomeController{ /** * 显示指定模型列表数据 - * @param String $model 模型标识 + * @param String $model 模型标识 * @author 麦当苗儿 */ - public function lists($model = null, $p = 0, $extend_map = array(), \Closure $appendCallback = null){ + public function lists($model = null, $p = 0, $extend_map = array(), \Closure $appendCallback = null) + { $model || $this->error('模型名标识必须!'); $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 @@ -71,92 +75,105 @@ class BaseController extends HomeController{ //解析列表规则 $fields = array(); // 关键字搜索 - $map = $extend_map; - $key = $model['search_key']?$model['search_key']:'title'; - if(isset($_REQUEST[$key])){ - $map[$key] = array('like','%'.$_GET[$key].'%'); + $map = $extend_map; + $key = $model['search_key'] ? $model['search_key'] : 'title'; + if (isset($_REQUEST[$key])) { + $map[$key] = array('like', '%' . $_GET[$key] . '%'); unset($_REQUEST[$key]); } // 条件搜索 - foreach($_REQUEST as $name=>$val){ - if(in_array($name,$fields)){ - $map[$name] = $val; + foreach ($_REQUEST as $name => $val) { + if (in_array($name, $fields)) { + $map[$name] = $val; } } - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + $name = parse_name(get_table_name($model['id']), true); - $data = M($name,"tab_") + $data = M($name, "tab_") /* 查询指定字段,不指定则查询所有字段 */ ->field(empty($fields) ? true : $fields) // 查询条件 ->where($map) /* 默认通过id逆序排列 */ - ->order($model['need_pk']?'id DESC':'') + ->order($model['need_pk'] ? 'id DESC' : '') /* 数据分页 */ ->page($page, $row) /* 执行查询 */ ->select(); /* 查询记录总数 */ - $count = M($name,"tab_")->where($map)->count(); - + $count = M($name, "tab_")->where($map)->count(); + //分页 - $parameter = $_POST; - $parameter['p']=I('get.p',1); - $parameter['row']=I('get.row'); - - $page = set_pagination($count,$row,$parameter); - if($page) {$this->assign('_page', $page);} - + $parameter = $_POST; + $parameter['p'] = I('get.p', 1); + $parameter['row'] = I('get.row'); + + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } + $hasList = false; if ($appendCallback) { - $appends = $appendCallback($data); - foreach ($appends as $key => $value) { - if ($key == 'list_data') { - $hasList = true; + $appends = $appendCallback($data); + foreach ($appends as $key => $value) { + if ($key == 'list_data') { + $hasList = true; + } + $this->assign($key, $value); } - $this->assign($key, $value); - } } - - $this->assign("count",$count); + + $this->assign("count", $count); $this->assign('model', $model); $this->assign('list_grids', $grids); if ($hasList == false) { - $this->assign('list_data', $data); + $this->assign('list_data', $data); } - $this->meta_title = $model['title'].'列表'; + $this->meta_title = $model['title'] . '列表'; $this->display($model['template_list']); } - public function data_lists($p,$model,$extend=[]){ + public function data_lists($p, $model, $extend = []) + { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 - - if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;} - + + if (isset($_REQUEST['row'])) { + $row = $_REQUEST['row']; + } else { + $row = 10; + } + $model = D($model); // 条件搜索 $map = []; - foreach(I('get.') as $name=>$val){ - $map[$name] = $val; + foreach (I('get.') as $name => $val) { + $map[$name] = $val; } - $map = array_merge($map,$extend['map']); - $lists_data = $model->where($map)->page($page,$row)->order($extend['order'])->select(); + $map = array_merge($map, $extend['map']); + $lists_data = $model->where($map)->page($page, $row)->order($extend['order'])->select(); $count = $model->where($map)->count(); //分页 - - $parameter = $_POST; - $parameter['p']=I('get.p',1); - $parameter['row']=I('get.row'); - - $page = set_pagination($count,$row,$parameter); - if($page) {$this->assign('_page', $page);} - - $this->assign('lists_data',$lists_data); - $this->assign('count',$count); + + $parameter = $_POST; + $parameter['p'] = I('get.p', 1); + $parameter['row'] = I('get.row'); + + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } + + $this->assign('lists_data', $lists_data); + $this->assign('count', $count); $this->display(); } @@ -166,63 +183,63 @@ class BaseController extends HomeController{ */ public function paginate($query, $defaultPageSize = 10, $defaultPage = 1) { - $page = I('get.p', $defaultPage); - $pageSize = I('get.row', $defaultPageSize); - - $countQuery = clone $query; - $count = $countQuery->count(); - $records = $query->page($page, $pageSize)->select(); - - $params = [ - 'p' => $page, - 'row' => $pageSize - ]; - $params = array_merge($params, $_POST); - $params = array_merge($params, $_GET); - $pagination = set_pagination($count, $pageSize, $params); - - return [$records, $pagination, $count]; + $page = I('get.p', $defaultPage); + $pageSize = I('get.row', $defaultPageSize); + + $countQuery = clone $query; + $count = $countQuery->count(); + $records = $query->page($page, $pageSize)->select(); + + $params = [ + 'p' => $page, + 'row' => $pageSize + ]; + $params = array_merge($params, $_POST); + $params = array_merge($params, $_GET); + $pagination = set_pagination($count, $pageSize, $params); + + return [$records, $pagination, $count]; } public function getRecordsByIds($query, $ids, $params = []) { - if (count($ids) == 0) { - return []; - } - $field = isset($params['field']) ? $params['field'] : 'id'; - $indexBy = isset($params['indexBy']) ? $params['indexBy'] : ''; - - $items = $query->where([$field => ['in', $ids]])->select(); - $records = []; - if ($indexBy) { - foreach ($items as $item) { - $records[$item[$field]] = $item; + if (count($ids) == 0) { + return []; } - return $records; - } - return $items; + $field = isset($params['field']) ? $params['field'] : 'id'; + $indexBy = isset($params['indexBy']) ? $params['indexBy'] : ''; + + $items = $query->where([$field => ['in', $ids]])->select(); + $records = []; + if ($indexBy) { + foreach ($items as $item) { + $records[$item[$field]] = $item; + } + return $records; + } + return $items; } public function getColumnsByIds($query, $ids, $column, $params = []) { - if (count($ids) == 0) { - return []; - } - $field = isset($params['field']) ? $params['field'] : 'id'; - $indexBy = isset($params['indexBy']) ? $params['indexBy'] : ''; - - $items = $query->where([$field => ['in', $ids]])->select(); - $records = []; - if ($indexBy) { - foreach ($items as $item) { - $records[$item[$field]] = $item[$column]; - } - } else { - foreach ($items as $item) { - $records[] = $item[$column]; - } - } - return $records; + if (count($ids) == 0) { + return []; + } + $field = isset($params['field']) ? $params['field'] : 'id'; + $indexBy = isset($params['indexBy']) ? $params['indexBy'] : ''; + + $items = $query->where([$field => ['in', $ids]])->select(); + $records = []; + if ($indexBy) { + foreach ($items as $item) { + $records[$item[$field]] = $item[$column]; + } + } else { + foreach ($items as $item) { + $records[] = $item[$column]; + } + } + return $records; } public function getLoginPromote() @@ -233,4 +250,32 @@ class BaseController extends HomeController{ } return $this->loginPromote; } + + //验证安全密码视图 + public function verifyPasswordView($modelList, $metaTitle) + { + $this->assign('modelList', $modelList); + $this->assign('metaTitle', $metaTitle); + $this->display('Public/verify_password'); + } + + //验证安全密码 + public function verifyPassword() + { + $password = I('post.password'); + $model = new \User\Api\PromoteApi(); + $res = $model->verify_er_User(PID, $password); + + if ($res) { + session('game_divide_second_pwd', $password); + + $data['status'] = 1; + $data['msg'] = '验证成功'; + } else { + $data['status'] = 0; + $data['msg'] = '安全密码不正确'; + } + + $this->ajaxReturn($data); + } } diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 54fb169d5..d17e0efd4 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -15,6 +15,7 @@ class FinanceController extends BaseController { public function settlementDtl() { + $metaTitle = '结算明细'; $securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码 $model = new PromoteApi(); $res = $model->verify_er_User(PID, $securityCode);//验证安全密码 @@ -85,9 +86,11 @@ class FinanceController extends BaseController $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('_page', $page); + $this->assign('meta_title', '结算明细'); + $this->display(); + } else { + $modelList = ['财务管理', $metaTitle]; + $this->verifyPasswordView($modelList, $metaTitle); } - - $this->assign('meta_title', '结算明细'); - $this->display(); } } \ No newline at end of file diff --git a/Application/Home/Controller/GameDivideController.class.php b/Application/Home/Controller/GameDivideController.class.php index 6db691700..a277d05c6 100644 --- a/Application/Home/Controller/GameDivideController.class.php +++ b/Application/Home/Controller/GameDivideController.class.php @@ -20,6 +20,7 @@ class GameDivideController extends BaseController $this->error('权限异常'); } + $metaTitle = '分成比例'; $securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码 $model = new PromoteApi(); $res = $model->verify_er_User(PID, $securityCode);//验证安全密码 @@ -77,29 +78,11 @@ class GameDivideController extends BaseController $this->assign('dataList', $data); $this->assign('count', $count); $this->assign('serverType', I('server_type', 0)); - } - - $this->meta_title = "分成比例"; - $this->display(); - } - - //验证安全密码 - public function verifyPassword() - { - $password = I('post.password'); - $model = new PromoteApi(); - $res = $model->verify_er_User(PID, $password); - - if ($res) { - session('game_divide_second_pwd', $password); - - $data['status'] = 1; - $data['msg'] = '验证成功'; + $this->meta_title = $metaTitle; + $this->display(); } else { - $data['status'] = 0; - $data['msg'] = '安全密码不正确'; + $modelList = ['游戏管理', $metaTitle]; + $this->verifyPasswordView($modelList, $metaTitle); } - - $this->ajaxReturn($data); } } \ No newline at end of file diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 50b732cbb..025216f0a 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -2281,15 +2281,18 @@ class PromoteController extends BaseController $this->ajaxReturn($data); } else { + $metaTitle = '设置'; if ($res) { $map['id'] = PID; $promoteData = D('Promote')->field('id,child_game_permission')->where($map)->find(); $this->assign('data', $promoteData); + $this->meta_title = $metaTitle; + $this->display(); + } else { + $modelList = ['游戏管理', $metaTitle]; + $this->verifyPasswordView($modelList, $metaTitle); } - - $this->meta_title = "设置"; - $this->display(); } } diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html index d995d0d40..f4c2a7744 100644 --- a/Application/Home/View/default/Finance/settlementDtl.html +++ b/Application/Home/View/default/Finance/settlementDtl.html @@ -3,7 +3,6 @@ - @@ -63,144 +62,95 @@ width: 180px; height: 34px; } - - .input-security { - width: 500px; - height: 2.5rem; - padding-left: 10px; - border-radius: 5px; - border: 0; - } - - .btn-security { - width: 300px; - height: 2.4rem; - border: 0; - border-radius: 5px; - background-color: #358fe4; - color: #fff; - } - - .btn-security-close { - width: 300px; - height: 2.4rem; - border: 0; - border-radius: 5px; - background-color: #fff; - color: #999; - }